问题描述
在使用virtualenvwrapper之前,我从未见过此消息,但是现在每当我运行mkvirtualenv <environment>
或workon <environment>
时,我都会突然看到此消息:
I never used to see this message before when using virtualenvwrapper, but now I'm suddenly seeing this message whenever I run, say, mkvirtualenv <environment>
or workon <environment>
:
Usage: source deactivate
removes the 'bin' directory of the environment activated with 'source
activate' from PATH.
我根本没有修改virtualenvwrapper,而快速的Google搜索仅产生此GitHub问题-我确实已经安装了IPython/Anaconda,但是我不确定它可能如何干扰virtualenvwrapper.无论如何,我都尝试同时更新(conda update conda; conda update ipython
)以及将virtualenvwrapper本身更新为v4.1.1,但是我仍然看到此错误.
I haven't modified virtualenvwrapper at all, and a quick google search only yields this GitHub issue -- I did install IPython/Anaconda a while back, but I'm not sure how it might be interfering with virtualenvwrapper. In any case, I tried updating both (conda update conda; conda update ipython
), as well as updating virtualenvwrapper itself to v4.1.1, but I'm still seeing this error.
我正在运行OS X 10.8.4.
I'm running OS X 10.8.4.
推荐答案
workon
调用deactivate
. Anaconda的垃圾箱中存在一个同名的脚本,因此它会被workon调用.
workon
, which is defined in /usr/local/bin/virtualenvwrapper.sh
, calls deactivate
. A script of the same name is present in Anaconda's bin, so it gets called by workon.
到目前为止,我找到的最好的解决方案是在Anaconda的bin中重命名激活和停用.如果有更好的解决方案,请发表评论,我将更新此答案.
The best solution I've found so far is to rename activate and deactivate in Anaconda's bin. If there's a better solution, please comment and I'll update this answer.
这篇关于为什么每次运行virtualenvwrapper命令时突然看到`Usage:source deactivate`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!