Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I am suddenly seeing `Usage: source deactivate` whenever I run virtualenvwrapper commands?

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. 

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.

I'm running OS X 10.8.4.

like image 876
3cheesewheel Avatar asked Nov 08 '13 21:11

3cheesewheel


2 Answers

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.

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.

like image 56
knite Avatar answered Nov 15 '22 17:11

knite


This happened to me after installing Anaconda from https://www.continuum.io/downloads. If you don't need the program and it will be uninstalled, remove the following from your ~/.bash_profile:

added by Anaconda2 4.2.0 installer
export PATH="//anaconda/bin:$PATH"
like image 24
jQN Avatar answered Nov 15 '22 18:11

jQN