我最近升级到10.9小牛队。我更新了brew,并为我的开发环境安装了python 2.7.6。我还更改了/ etc / paths,以便/ usr / local / bin /在/ usr / bin之前。一切似乎工作得很好,除了当我尝试使用virtualenvwrapper创建一个虚拟环境时,我得到一个追溯错误,说是DistributionNotFound:virtualenv。非常感谢任何帮助。
$ /usr/bin/python --version
Python 2.7.5
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.6
$ pip install virtualenv
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages
Cleaning up...
$ pip install virtualenvwrapper
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Cleaning up...
$ mkvirtualenv test
Traceback (most recent call last):
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.11.5
以下是我的〜/ .bash_profile:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
答案 0 :(得分:0)
我通过运行解决了我的问题:
sudo pip uninstall virtualenvwrapper
sudo pip install virtualenvwrapper==4.1.1