Easy_install 和 Pip 不起作用 [英] Easy_install and Pip doesn't work
问题描述
当我尝试这样做时,Easy_install 和 Pip 在 python 2.7 上不再工作:
Easy_install and Pip doesn't work anymore on python 2.7, when I try to do:
sudo easy_install pip
我明白了:
Traceback (most recent call last):
File "/usr/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
parse_requirements(__requires__), Environment()
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.15
当我尝试时:
sudo pip install [package]
我明白了:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
parse_requirements(__requires__), Environment()
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==0.8.2
我已经安装了它们(是的,首先删除了它们),但没有结果......
I've already install both of them (and yes, first deleted them), but no result...
谢谢!
推荐答案
尝试
sudo easy_install Distribute
如果存在,但太旧了
sudo easy_install -U Distribute
看起来 Distribute/setuptools(它的旧名称)被搞砸了,或者 Python 包设置.如果其中任何一个都没有帮助,请尝试删除完整的 Python 2.7 安装并从头开始重新安装所有内容.
Looks like either Distribute/setuptools (it's old name) is messed up or Python package settings. If either of these do not help, try removing the full Python 2.7 installation and reinstall everything from the scratch.
造成混乱的可能原因是您同时使用了 sudo easy_install/sudo pip 和 Linux 分发包来混合和匹配系统范围的安装包.如果你使用 pip/easy_install(不需要 sudo),你应该使用 virtualenv
Possible reasons for the mess is that you have used both sudo easy_install / sudo pip and Linux distribution packages to mix and match system-wide installation packages. You should use virtualenv instead if you use pip/easy_install (no sudo needed)
http://pypi.python.org/pypi/virtualenv
这篇关于Easy_install 和 Pip 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!