0

So I'm trying to install virtualenvwrapper and then as a requirement for the task I'm trying to implement I'm supposed to update my .bash_profile file to contain the lines

source /usr/local/bin/virtualenvwrapper.sh

But after activating the changes to the file I get

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

So that's because using pip install virtualenv the package gets installed in ./Library/Python/2.7/lib/python/site-packages .

My question is, is it okay to manually relocate the packages? What would be the way to do so?

momo
  • 1,052
  • 5
  • 16
  • 34

1 Answers1

0

Just change the path in your source command to match the location of the script, which should be where pip installed it, that is in /usr/local/bin if you used sudo pip install to install it system wide, or wherever the bin directory associated with your python environment is located. That would /path/to/virtualenv/local/bin if you are using a virtualenv, or /path/to/anaconda/bin if you are using anaconda's python distribution.

Anis
  • 2,984
  • 17
  • 21
  • This happened. `/Library/Python/2.7/lib/python/site-packages/virtualenvwrapper.sh: No such file or directory` – momo Mar 08 '17 at 12:55
  • Any idea how to find out where this virtualenvwrapper.sh file may be? – momo Mar 08 '17 at 12:59
  • http://stackoverflow.com/questions/12647266/where-is-virtualenvwrapper-sh-after-pip-install found this. okay. – momo Mar 08 '17 at 13:01
  • For me it ends up in ```/usr/local/bin``` and the corresponding location when using anaconda (```path/to/anaconda/bin/```) – Anis Mar 08 '17 at 13:04
  • using _pip install_ the file was not found anywhere in the system, using sudo worked for me and put it in `usr/local/bin` but I'd like to avoid using it. Well. Thanks anyway! – momo Mar 08 '17 at 13:12
  • If you don't want to use system wide library, you can use a virtualenv, activate it, and when pip install virtualenvwrapper, you will find virtualenvwrapper.sh in ```/path/to/virtualenv/local/bin```, so you don't have to use superuser privileges. – Anis Mar 08 '17 at 13:16
  • 1
    There is a difference between `./Libray/Python...` (which is a relative path, probably referring to the user's personal `Library` folder, i.e., `/Users/momo/Library/Python/...`) and `/Library/Python/...`, which is a global path usable by all users. – chepner Mar 08 '17 at 13:27
  • Yes you are right, but I didn't really pay attention to that since, the problem doesn't seem to be where the librairies are installed, rather where corresponding binaries are. I've edited my answer, I hope it makes this clearer. – Anis Mar 08 '17 at 13:32