2

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?

Deepend
  • 4,057
  • 17
  • 60
  • 101
  • If you installed it within your `virtualenv` then that's where it will be, not in the system global `/usr/local/bin`. – tripleee Jun 06 '14 at 16:00
  • No, I did not install it in a virtualenv. I installed it globally. Have just uninstalled and reinstalled to confirm – Deepend Jun 06 '14 at 16:12
  • `pip` should have created a log file. – tripleee Jun 06 '14 at 16:15
  • Your recent edit is a game-changer. Apt generally puts stuff in `/usr/bin`, not `/usr/local/bin`; but in this case, that's not the case at all, either. You can see the list of installed files in `/var/lib/dpkg/info/virtualenvwrapper.list` – tripleee Jun 06 '14 at 18:21
  • The file list is also visible at http://packages.ubuntu.com/trusty/all/virtualenvwrapper/filelist – tripleee Jun 06 '14 at 18:23

1 Answers1

2

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

Community
  • 1
  • 1
tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Thanks for your help. Just to clarify in my situation "source /etc/bash_completion.d/virtualenvwrapper.sh" would not work for me but "source /etc/bash_completion.d/virtualenvwrapper" would. – Deepend Jun 06 '14 at 18:32