centos6.5更新python2.7影响pip和easy_install

前端之家收集整理的这篇文章主要介绍了centos6.5更新python2.7影响pip和easy_install前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • 一般更新python的时候只知道会影响yum,但没注意会影响pip和easy_install,需要卸载安装@H_502_3@


    @H_502_3@

  1. 安装依赖环境@H_502_3@

    1. 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_502_3@

  2. 安装python@H_502_3@

    1. wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz@H_502_3@

    2. tar -xvf Python-2.7.8.tar.xz@H_502_3@

    3. cd Python-2.7.8 &&./configure && make && make install@H_502_3@

    4. mv /usr/bin/python /usr/bin/python_old@H_502_3@

    5. ln -s /usr/local/bin/python2.7 /usr/bin/python@H_502_3@

  3. 修改yum@H_502_3@

    1. vim /usr/bin/yum(把第一行的语言环境改成python_old)@H_502_3@

  4. 安装pip@H_502_3@

    1. wget https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196@H_502_3@

    2. tar xf pip-7.1.2.tar.gz &&cd pip-7.1.2 && python setup.py install@H_502_3@

    3. pip install --upgrade pip@H_502_3@

    4. pip -V@H_502_3@

  5. 安装easy_install@H_502_3@

    1. wget https://pypi.python.org/packages/source/s/setuptools/setuptools-18.2.tar.gz#md5=52b4e48939ef311d7204f8fe940764f4@H_502_3@

    2. tar fxz setuptools-18.2.tar.gz &&cd setuptools-18.2 &&python setup.py install@H_502_3@

猜你在找的CentOS相关文章