升级到OS X 10.9 Mavericks并安装了XCode、命令行工具、XQuartz等。现在尝试运行pip安装,但它说找不到发行版:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.4.1
所以我试着用一个简单的安装pip。原来那也有问题:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2607, in <module>
parse_requirements(__requires__), Environment()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: setuptools==1.1.6
所以其他一些线程说要用sudo python ez_setup.py重新安装setuptools。看起来效果不错:
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg
Processing dependencies for setuptools==1.1.6
Finished processing dependencies for setuptools==1.1.6
但是当运行easy_install pip时,同样的pkg_resources.DistributionNotFound:setuptools==1.1.6错误发生。还有人有这个问题吗?有什么办法解决这个问题吗?
尝试
sudo python -m easy_install pip
我遇到了类似的问题。
The git-review team said it was a bug with pkg_resources可以用
这对我很有效。
安装
easy_install
:从https://pypi.python.org/pypi/setuptools下载
ez_setup.py
模块安装
pip
:相关问题 更多 >
编程相关推荐