6

When I run the commmand

pip install virtualenv

I get:

Installing virtualenv script to /usr/local/share/python

But my default virtualenv is in a different place:

which virtualenv
usr/local/bin/virtualenv

I'd like pip to install to the usr/local/bin directory by default. Any help would be greatly appreciated.

jeromej
  • 10,508
  • 2
  • 43
  • 62
owilde1900
  • 473
  • 2
  • 7
  • 13

2 Answers2

6

If you want to manually decide where you want packages to reside, you could always download the source distribution to a directory of your choice with the following:

pip install -d <path_to_my_directory>

But when you install, I think you probably want to put the executable console scripts (as defined in the package's setup.py file; like virtualenv for example) in a directory included in your $PATH environmental variable.

You can specify this manually by doing the following:

sudo python setup.py install --install-scripts /usr/bin/

orsudo python setup.py install --install-scripts /usr/local/bin/

Let me know if you have any other questions...

damzam
  • 1,921
  • 15
  • 18
  • I was able to make this edit, but I'm afraid I went over my head with this. Now when when I try to run virtualenv or virtualenvwrapper I get other errors 'File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 518, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: virtualenv==1.8.2' – owilde1900 Sep 26 '12 at 18:48
  • thank you for your help, I ended up having to add usr/local/share to my paths because pip was putting everything in there. Big mess but looks like i patched it together – owilde1900 Sep 26 '12 at 19:48
  • glad you got it working. Once you have the virtualenv activated, console scripts will be put in a virtualenv-specific bin directory. – damzam Sep 27 '12 at 01:51
  • Also, you might want to consider upgrading to Python 2.6 – damzam Sep 27 '12 at 01:52
4

/usr/local/bin is for executable programs. /usr/local/share is to store data that is independent of the architecture.

So, in your case, you are installing by default in /usr/local, where the executable programs live in /usr/local/bin, the arquitecture-independent data lives in /usr/local/share, configuration files live in /usr/local/etc, etc.

You can check Filesystem_Hierarchy_Standard to get an overview on the topic.

gpoo
  • 8,408
  • 3
  • 38
  • 53