一般更新python的时候只知道会影响yum,但没注意会影响pip和easy_install,需要卸载安装
安装依赖环境
yum install zlib-devel zlibopenssl openssl-devel readline-devel(zlib安装setuptools的时候会用到,没有的会报“RuntimeError: Compression requires the (missing) zlib module”;openssl是pip会用到,没有会报ImportError: cannot import name HTTPSHandle,如果不提前安装会来回重新编译安装python,很浪费时间)
@H_403_36@
安装python
wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
tar -xvf Python-2.7.8.tar.xz
cd Python-2.7.8 &&./configure && make && make install
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/bin/python2.7 /usr/bin/python
@H_403_36@
修改yum
vim /usr/bin/yum(把第一行的语言环境改成python_old)
@H_403_36@
安装pip
wget https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196
tar xf pip-7.1.2.tar.gz &&cd pip-7.1.2 && python setup.py install
pip install --upgrade pip
pip -V
@H_403_36@
安装easy_install
tar fxz setuptools-18.2.tar.gz &&cd setuptools-18.2 &&python setup.py install
@H_403_36@
@H_403_36@ 原文链接:https://www.f2er.com/centos/381054.html