发布时间:2019-09-08 09:09:06编辑:auto阅读(2384)
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性能的一些建议
52416
52341
42447
39348
33813
30763
29520
24440
24296
22666
197°
202°
207°
240°
197°
332°
326°
347°
347°
396°