cd /usr/local/src
wget http://mirrors.sohu.com/python/3.6.4/Python-3.6.4.tgz
yum -y install zlib* python-devel mysql-devel zlib-devel openssl-devel
tar xf Python-3.6.4.tgz
cd Python-3.6.4/
./configure --enable-shared --enable-loadable-sqlite-extensions --with-zlib
./configure --enable-optimizations
make
make install
rm -rf /usr/bin/python
ln -s /usr/local/bin/python3.6 /usr/bin/python
sed -i 's/\#\!\/usr\/bin\/python/\#\!\/usr\/bin\/python2/' /usr/bin/yum
sed -i 's/\#\! \/usr\/bin\/python/\#\! \/usr\/bin\/python2/' /usr/libexec/urlgrabber-ext-down
echo "/usr/local/lib" >> /etc/ld.so.conf
/sbin/ldconfig
mkdir -p /root/.pip/
cat > /root/.pip/pip.conf <<EOF
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
EOF
python -V
python 3.6.4 一键安装
原创
©著作权归作者所有:来自51CTO博客作者go工程师的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
NGINX一键安装脚本
一键安装NGINX
nginx c++ 下载安装