码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-08-24 01:25:12      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:python pip easy_install yum 升级 setuptool

  • 一般更新python的时候只知道会影响yum,但没注意会影响pip和easy_install,需要卸载安装


  1. 安装依赖环境

    1. yum install zlib-devel zlib openssl openssl-devel readline-devel (zlib安装setuptools的时候会用到,没有的会报“RuntimeError: Compression requires the (missing) zlib module”;openssl是pip会用到,没有会报ImportError: cannot import name HTTPSHandle,如果不提前安装会来回重新编译安装python,很浪费时间)

  2. 安装python

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

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

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

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

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

  3. 修改yum

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

  4. 安装pip

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

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

    3. pip install --upgrade pip

    4. pip -V

  5. 安装easy_install

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

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

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

标签:python pip easy_install yum 升级 setuptool

原文地址:http://wangxiaowu.blog.51cto.com/6202300/1841648

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!