I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons I can't/don't want to do that.
So how do I modify the command
pip install package_name
pip install the package somewhere other than the default
pip install --install-option="--prefix=$PREFIX_PATH" package_name
You might also want to use
--ignore-installed to force all dependencies to be reinstalled using this new prefix. You can use
--install-option to multiple times to add any of the options you can use with
python setup.py install (
--prefix is probably what you want, but there are a bunch more options you could use).
The --target switch is the thing you're looking for:
pip install --target=d:\somewhere\other\than\the\default package_name
But you still need to add
PYTHONPATH to actually use them from that location.
-t, --target <dir>
Install packages into <dir>. By default this will not replace existing files/folders in <dir>.
Use --upgrade to replace existing packages in <dir> with new versions.
Upgrade pip if target switch is not available:
On Linux or OS X:
pip install -U pip
On Windows (this works around an issue):
python -m pip install -U pip