升級python到2.7版本pip不可用


升級python到2.7版本pip不可用

[root@localhost pip-7.1.2]# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/python27/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2675, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/python27/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==7.1.0
解決方法:
重新安裝pip
curl -O https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz
用wget下載時會報錯,這里改用curl -O
tar zxvf pip-7.1.2.tar.gz     
cd pip-7.1.2    
python setup.py install
ln -s /usr/local/python27/bin/pip2.7 /usr/bin/pip  #創建軟鏈接時報文件已經存在時執行rm -rf /usr/bin/pip
//pip默認安裝到了/usr/local/python27/bin下面 

測試pip

[root@localhost pip-7.1.2]# pip list
distribute (0.6.14)
pip (7.1.2)
setuptools (0.6rc11)
wheel (0.29.0)
The directory '/root/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/usr/local/python27/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM