1

我刚刚将我的 OS X 从 10.7 更新到 10.8(山狮)。当我尝试运行 virtualenv venv --distribute 时出现此错误

File "/usr/local/bin/virtualenv", 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: virtualenv==1.8.2

当我运行 which python 我得到 /usr/bin/python 当我运行 which virtualenv 我得到 /usr/local/bin/virtualenv

似乎路径随着升级而改变,有人知道如何修复它吗?

谢谢

4

1 回答 1

1

我能够通过卸载 virtualenv 然后重新安装 virtualenv 来解决这个问题。

卸载

sudo pip uninstall virtualenv

安装

sudo pip install virtualenv
于 2014-07-02T01:30:08.753 回答