发布时间:2019-09-08 09:09:06编辑:auto阅读(1990)
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清理一天之前的文件
下一篇: 提高Python性能的一些建议
48916
48017
38781
35912
30331
27112
26117
20950
20774
19132
640°
719°
694°
688°
659°
628°
723°
774°
916°
1111°