python 3.6.4 一键安装
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
相关文章