Search code examples
ubuntuubuntu-12.04virtualenvwrapper

Setting up VirtualenvWrapper on Ubuntu 12.04: Location of virtualenvwrapper.sh?


I use Virtualenv and VirtualenvWrapper on my local machines and find them wonderful tools. I am trying to set the same up on a virtual machine running Ubuntu 12.04 server and Apache for my production Python applications.

Virtualenv is working fine. But I am having issues configuring VirtualenvWrapper. I have installed it via pip. pip freeze gives me

virtualenv==1.7.1.2
virtualenvwrapper==2.11.1

I have followed the instructions on the documentation

$ pip install virtualenvwrapper 

NOTE: See Edit below virtualenvwrapper was actually installed via apt-get. i did follow the rest fo the instructions though.

...
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME

but when I try the next step

$ source /usr/local/bin/virtualenvwrapper.sh

I get an error

-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory

My /usr/local/bin/ only has one file in it django-admin.py

The documentation states

First, some initialization steps. Most of this only needs to be done one time. You will want to add the command to source /usr/local/bin/virtualenvwrapper.sh to your shell startup file, changing the path to virtualenvwrapper.sh depending on where it was installed by pip.

How can i find the location of this file?

Using find / -name "virtualenvwrapper.sh" just outputs a list of Permission denied errors

Running find / -name virtualenvwrapper gives me

/usr/share/doc/virtualenvwrapper
/usr/share/pyshared/virtualenvwrapper
/usr/share/doc-base/virtualenvwrapper
/usr/share/python/ns/virtualenvwrapper
/usr/lib/python2.7/dist-packages/virtualenvwrapper

Any advice on how to find the file would be great

EDIT:

I actually installed virtualenvwrapper via apt-get due to an issue with my proxy

sudo apt-get install virtualenvwrapper

Possibly this pits the virtualenvwrapper.sh in a different place?


Solution

  • Read the README.Debian of the package you installed (and generally whenever you install an unfamiliar package). It is in /usr/share/doc/virtualenvwrapper and it tells you that the file you are looking for is installed in /etc/bash_completion.d/virtualenvwrapper.

    See also https://askubuntu.com/questions/251378/where-is-virtualenvwrapper-sh