我刚刚将OS X从10.7更新到10.8(moutain lion)。 当我尝试运行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
当我运行哪个python时,我得到/ usr / bin / python 当我运行virtualenv时,我得到/ usr / local / bin / virtualenv
似乎路径已随着升级而改变,有人知道如何修复它吗?
谢谢
答案 0 :(得分:1)
我能够通过卸载virtualenv然后重新安装virtualenv来解决这个问题。
卸载
sudo pip uninstall virtualenv
安装
sudo pip install virtualenv