18

I use virtualenvwrapper from apt. It's working OK with bash but I recently switched to zsh. Now when I try workon in zsh I get zsh: command not found: workon Because I'm using oh-my-zsh script/plugins I thought it will be sufficient to add virtualenv and virtualenvwrapper plugins to my .zshrc plugins=. But it did not help. What else I need to configure to make it work under zsh?

PS to be clear - I still can use bash for this - nothing broken here...

Lord_JABA
  • 2,545
  • 7
  • 31
  • 58

1 Answers1

40

I just test it on ubuntu 14.04 and i had the same problem. To fix it add this to your .zshrc

 source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

or run this in terminal

 echo source /usr/share/virtualenvwrapper/virtualenvwrapper.sh >> ~/.zshrc
buluba89
  • 776
  • 8
  • 6
  • 3
    In Mac OS X I had to do: ``echo source /usr/local/bin/virtualenvwrapper.sh >> ~/.zshrc`` – amb Jul 22 '15 at 07:53
  • For me on ubuntu 14.04 (and generally following virtualenvwrapper's installation instructions), I needed to add `source /usr/local/bin/virtualenvwrapper.sh` to .zshrc. Also, if you're using a nonstandard location for your virtualenvs, be sure to add `export WORKON_HOME=/path/to/virtualenvs` before the source line. – StaringFrog Oct 27 '15 at 03:51
  • 1
    If you installed `py27-virtualenvwrapper` with Macports on OSX: `echo source /opt/local/bin/virtualenvwrapper2.7.sh >> ~/.zshrc` – rdbisme Dec 29 '15 at 17:28
  • Whats about virtualenv in ArchLinux? – SalahAdDin May 14 '16 at 10:14
  • According to arch wiki the path is /usr/bin/virtualenvwrapper.sh I havent tested it (i dont have an arch installation) but probably `echo source /usr/bin/virtualenvwrapper.sh >> ~/.zshrc` will do the trick ;) – buluba89 May 17 '16 at 03:14
  • 1
    I am using lazy wrapper `source /usr/local/bin/virtualenvwrapper_lazy.sh` it works fine with shortcuts `workon` or `makevirtualenv` as such. – Ozkan Serttas Oct 26 '19 at 17:24