百度下 教程发现流程需要2篇以上才能凑齐答案
现在自己整理合并答案吧 老人家了容易忘事 写下后用(centos 也快Good bye 了 应该还有机会吧。。。。)
1.下载python
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.17.tgz tar xvzf Python-2.7.18.tgz cd Python-2.7.18 ./configure --enable-optimizations make && make altinstall
安装完成 路径是 /usr/local/bin/python2.7 -V
2.换2.6软连接
mv /usr/bin/python /usr/bin/python2.6.6 ln -s /usr/local/bin/python2.7 /usr/bin/python
yum故障
sed -i 's/python/python2.6.6/' /usr/bin/yum
网上教程到这部分基本就乱了或者完了,更新pip的写的有点乱~我整理吧
3.升级pip
wget http://peak.telecommunity.com/dist/ez_setup.py vi ez_setup.py
改http为https
https://pypi.python.org
sudo /opt/python27/bin/python ez_setup.py wget https://bootstrap.pypa.io/pip/2.7/get-pip.py python get-pip.py mv /usr/bin/pip /usr/bin/pip2.6.6 ln -s /usr/local/bin/pip /usr/bin/pip
4.py2.7和配套pip升级完成