virtualenvwrapper PATH问题

时间:2017-09-08 00:23:28

标签: python virtualenv homebrew virtualenvwrapper

我正在设置一台新机器(OSX 10.12.6)并尝试设置我的python环境。我用brew安装了2和3。其他问题中描述的解决方案似乎没什么帮助。

.zshrc看起来像这样:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/projects
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

source /usr/local/bin/virtualenvwrapper.sh

我在打开新shell时遇到错误:

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.

奇怪的是,一切正常 - 我可以使用mkvirtualenv就好了。但我不想要错误信息而且我不知道我的路径是怎么回事?请帮忙!

我用pip和pip3安装了virtualenv和wrapper

pip freeze:

pbr==3.1.1
six==1.10.0
stevedore==1.26.0
virtualenv==15.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.8.1

$ PATH:

/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

0 个答案:

没有答案