python2.6升级至python3.6
2019-10-30 本文已影响0人
夏2018
- 下载安装包
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
- 解压安装包
tar xf Python-3.6.3.tgz
- 进入目录
cd Python-3.6.3
- 安装依赖包
yum install gcc glibc zlib-devel openssl-devel -y
- 检查环境和配置
./configure
- 编译安装
make && make install
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python3 /usr/bin/python
vim /usr/bin/yum 把python改成python2.6.6
- 安装pip
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar zxf pip-9.0.1.tar.gz
cd pip-9.0.1
python setup.py install