3

I'm on OS X and my Pip installs to

/Library/Python/2.7/site-packages

I would like my pip to install to:

/usr/local/lib/python2.7/site-packages

How could I achieve this? I haven't found a way yet

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Anthony
  • 13,434
  • 14
  • 60
  • 80

1 Answers1

4

pip has an option for target directory --target, when installing package use

pip install --target=/usr/local/lib/python2.7/site-packages package_name

to install to your target directory.

if target option not available, check pip version & for possible upgrade or as mentioned in comments the error may be related to OSX/Homebrew install, check here for details.

Renjith Thankachan
  • 4,178
  • 1
  • 30
  • 47
  • `$ pip install --target=/Library/Python/2.7/site-packages pydub` returns as `DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both` – Anthony Dec 14 '16 at 03:37
  • Thanks, I will upvote this when I have back under my limit (2h) – Anthony Dec 14 '16 at 21:39