1

We're using easy_install to install to a local build environment directory on windows.

(This helps with having several checked out versions using different third-party packages simultaneously, etc. Sort of like virtualenv but for C/C++/Java/.NET too. :)

By using --install-dir I can get the python packages into a path with .pth files (to which our PYTHONPATH points) and --script-dir to a dir included in PATH, so that everything is runnable from our command prompt.

So, today I use something like:

python ez_setup.py -d c:\_work\theproject\3rd\python -s c:\_work\theproject\3rd\bin\ sphinx=1.0.5

But, I'd like to use pip instead, simply because it has a local cache. (Helps with our build slaves too, which currently re-download these packages two-three times a day.)

However, I haven't been able to coax pip into doing the same thing as easy_install.

Any ideas?

Macke
  • 24,812
  • 7
  • 82
  • 118
  • 2
    This might help with the first: http://stackoverflow.com/questions/2915471/pip-how-do-i-install-a-python-package-into-a-different-directory For the second, run pip install --help and take a look at install-option – SteveMc Apr 13 '11 at 13:43
  • @SteveMc: I've tried before with --install-option, but it wouldn't work as expected. I'll try again and update with more details of input/output. – Macke Apr 14 '11 at 08:42
  • ok; let me know what you get. The output of --help for --install-option includes: "(use like --install-option="--install-scripts=/usr/local/bin)", but we don't have a custom script location so I don't use this option. – SteveMc Apr 14 '11 at 15:17
  • @SteveMc: --prefix adds /lib/site-packages on Windows. I don't want that. I've managed to fix it by ising --install-purelib & --install-platlib. See my answer. – Macke Apr 28 '11 at 10:45

1 Answers1

0

--install-dir is possible to emulate using --install-purelib and --install-platlib:

Like this:

--install-option=--install-purelib=<installdir>
--install-option=--install-platlib=<installdir>

Note that specifying double-quotes (") around the install option as SteveMc did in the comment does not work when calling pip.exe using python.subprocess.call and when running on windows.

Macke
  • 24,812
  • 7
  • 82
  • 118