升级到Mac OS X 10.8(Mountain Lion),并在尝试致电时出现以下错误$ 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.1
更新:尝试通过再次执行安装过程(使用http://www.pip-installer.org/en/latest/installing.html#using-the-installer和easy_install
)重新安装,但没有成功,却得到了相同的结果错误。
现在尝试以下操作:调用$ sudo pip
,以上错误消失。奇怪的是,在上述错误消息中找不到的目录指向/ System / Library / ...,而python安装是(new?),可以在/ Library / Frameworks / ..中找到:
$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
知道如何摆脱sudo吗?
root
有所不同$PATH
。您已经安装了两个Python副本,并且对于所使用的版本并不小心。使用Apple Python(在/ System和/ usr中)或您安装的一个Python;看一看脚本的第一行,pip
看看它在使用哪一个。