停用virtualenvwapper和anaconda中的冲突
我正在使用virtualenv切换我的python dev env.但是当我运行workon my_env
时,遇到了这样的错误消息:
I'm using virtualenv to switch my python dev env. But when I run workon my_env
, I meet such error message:
Error: deactivate must be sourced. Run 'source deactivate'
instead of 'deactivate'.
Usage: source deactivate
removes the 'bin' directory of the environment activated with 'source
activate' from PATH.
在Google上进行一些搜索后,似乎在/usr/local/bin/virtualenvwrapper.sh中定义的workon
调用了deactivate
.在Anaconda的垃圾箱中有一个同名的脚本,因此它被workon错误地调用.
After some searches on google, it seems that workon
, which is defined in /usr/local/bin/virtualenvwrapper.sh, calls deactivate
. And there is a script with the same name is present in Anaconda's bin, so it gets called by workon by mistake.
是否有解决此冲突的建议?
Any suggestion for working around this conflict?
对我有用的一种解决方案是在Anaconda的垃圾箱中重命名deactivate
:
One solution which works for me is to rename deactivate
in Anaconda's bin:
mv deactivate conda-deactivate