The --target switch is the thing you're looking for:
pip install --target=d:somewhereother han hedefault package_name
But you still need to add d:somewhereother han hedefault
to 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
refer to
https://stackoverflow.com/questions/2915471/install-a-python-package-into-a-different-directory-using-pip