通过自制软件安装python:
brew install python --universal --framework
按照https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python的说明安装pip并升级发布. pip install似乎很好,但每当我尝试使用pip升级分发或安装virtualenv时
pip install --upgrade distribute
要么
pip install virtualenv
我收到以下错误:
Traceback (most recent call last): File “/usr/local/bin/pip”,line
5,in
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
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.0.2
在python中不够精通,不知道这里发生了什么,所以如果有人知道如何纠正这一点,将不胜感激.
我的$PATH看起来像这样:
/Users/wg/.rvm/gems/ruby-1.9.3-p125@rails3_2/bin:/Users/wg/.rvm/gems/ruby-1.9.3-p125@global/bin:/Users/wg/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/wg/.rvm/bin:/usr/local/bin:/usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
…当我运行哪个pip时,我得到/usr/local/bin / pip(不确定这是否是问题,如果是这样,该怎么做才能让它使用正确版本的pip).
编辑:
希望包含我运行Lion OS 10.7的最新版本的XCode和安装的Command实用程序.此外,不知道这是否有帮助,但我想我还包括运行“哪个easy_install”的结果……返回:
/usr/local/share/python/easy_install
不确定这是否也可能相关.
非常感谢!
pip install --upgrade setuptools
之前
pip install --upgrade distribute
pip install --upgrade pip
运行pip install –upgrade distribute时解决了我的问题.