Error message for virtualenvwrapper on OS X Lion

拜拜、爱过 提交于 2019-12-04 23:36:51

Since you have your own version of python, have you tried overriding VIRTUALENVWRAPPER_PYTHON? (It looks like you want export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python) The virtualenvwrapper docs suggest setting that envvar to the desired python before sourcing virtualenvwrapper.sh. Their example has:

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh

Add or change path into ~/.bash_profile for virtualenvwrapper.sh to /usr/local/share/python/virtualenvwrapper.sh

it should look like

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export WORKON_HOME=$HOME/.virtualenvs

source /usr/local/share/python/virtualenvwrapper.sh

I ran into similar problems with Hombrew-installed Python conflicting with the system-installed Python under OS X Lion. I was never able to correct the problem using Homebrew. However, when I switched to using pythonbrew (https://github.com/utahta/pythonbrew) to manage my installed Pythons (instead of Homebrew), I was able to run virtualenvwrapper successfully.

If your using PythonBrew & VirtualEnvBurrito with ZSH shell, make sure you check out your .zprofile - this contains some commands to execute the VirtualEnvBurrito startup script. As .zprofile is loaded before .zshrc the Python version is the system one. This will also throw up this error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!