I don't know what's more embarrassing: that I don't know how to go about finding the answer to this question myself, or that it has to be asked at all in the first place, but...

where does apt-get put the virtualenvwrapper.sh script after it installs virtualenvwrapper?

I'm at wits' end...

% sudo apt-get install virtualenvwrapper
% rehash
% which virtualenvwrapper.sh
virtualenvwrapper.sh not found
% which virtualenvwrapper
virtualenvwrapper not found
% find / -path /media -prune -o -name virtualenvwrapper.sh
% dpkg-query -L virtualenvwrapper | grep 'virtualenvwrapper\.sh'
% sudo apt-get install virtualenvwrapper
Reading package lists...
Building dependency tree...
Reading state information...
virtualenvwrapper is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I've run out of things to try: apt-get says virtualenvwrapper is already installed, but I can't find any sign of virtualenvwrapper.sh anywhere.

UPDATE: Well, I just discovered that the file


...looks very much like virtualenvwrapper.sh. I can't tell whether this file was put there by apt-get when I ran apt-get install virtualenvwrapper (the file's mdate is several months ago), but if it was, then I'm mystified by the apparent stupidity of the arrangement... For one thing, not everyone uses bash (I happen to use zsh). For another, one may want to run virtualenvwrapper.sh at times other than startup... I'm sure I'm missing something major here, but on the surface, it sure looks like the apt-get installation of virtualenvwrapper is plain retarded... At any rate, it wasted about three hours of my time...

  • 2
    Another zsh-user here... might as well stop using the official package for virtualenvwrapper, fewer surprises that way! – kaleissin Aug 11 '13 at 10:07
  • You can source /etc/bash_completion.d/virtualenvwrapper in zsh as well. It works fine as-is. – Jim Stewart Nov 17 '13 at 4:15
  • @JimStewart I can do lots of things. Point of a package is that I don't have to. – Melvyn Jul 6 '14 at 19:00

From /usr/share/doc/virtualenvwrapper/README.Debian:

In contrast to the information in
/usr/share/doc/virtualenvwrapper/en/html/index.html this package installs
virtualenvwrapper.sh as /etc/bash_completion.d/virtualenvwrapper.

Virtualenvwrapper is enabled if you install the package bash-completion and
enable bash completion support in /etc/bash.bashrc or your ~/.bashrc.

If you only want to use virtualenvwrapper you may just add

 source /etc/bash_completion.d/virtualenvwrapper

to your ~/.bashrc.

Yes, it's a bit hard to find :D

| improve this answer | |
  • 2
    What about zsh users? Great, another package that behaves differently on each OS. I think a sudo apt-get purge virtualenvwrapper and sudo pip install virtualenvwrapper is in order. – metakermit Nov 8 '13 at 12:54
  • 1
    You can source /etc/bash_completion.d/virtualenvwrapper in zsh as well. It works fine as-is. – Jim Stewart Nov 17 '13 at 4:14

On Ubuntu

The script's location is:


So if you've installed virtualenvwrapper with the package manager, you must add the following lines into your ~/.bashrc:

export WORKON_HOME=~/.virtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

Also, remember to reload your ~/.bashrc with:

$ source ~/.bashrc

If everything worked well, then you'll be able to run mkvirtualenv like:

mkvirtualenv --python="/usr/bin/python3" venv_name
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.