点子坏了.如何修复 DistributionNotFound 错误? [英] pip broke. how to fix DistributionNotFound error?
问题描述
每当我尝试使用 pip 时,都会出现错误.例如:
Whenever i try to use pip I get an error. For exampple:
$ sudo pip install gevent-websocket
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2675, in <module>
parse_requirements(__requires__), Environment()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 552, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==0.8.1
我很想将 的值更改为 pip==0.8.2.. 但我不觉得要处理破解"我的安装的后果......我正在运行 python 2.7,而 pip 的版本是 0.8.2.
I feel tempted to change the value of into pip==0.8.2.. but I dont feel dealing with the consequences of 'hacking' up my installation... I'm running python 2.7 and pip is at version 0.8.2.
推荐答案
我在我的 MacBook 上发现了这个问题,原因是因为正如@Stephan 所说,我使用 easy_install
来安装 pip,并且py 包管理工具的混合导致 pkg_resources.DistributionNotFound
问题.解决办法是:
I find this problem in my MacBook, the reason is because as @Stephan said, I use easy_install
to install pip, and the mixture of both py package manage tools led to the pkg_resources.DistributionNotFound
problem.
The resolve is:
easy_install --upgrade pip
请记住:只需使用上述一个工具来管理您的 Py 包.
Remember: just use one of the above tools to manage your Py packages.
这篇关于点子坏了.如何修复 DistributionNotFound 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!