Reputation: 2027
I have a problem on Windows 10 where both Python 2.6 and 2.7 are installed.
python -m pip install myPack --no-index --find-links=. --user
When running this command with user AutoUser it installs myPack to Default user directory C:\Users\Default\Python\Python27\site-packages or C:\Users\Default\Appdata\Roaming\Python\site-packages instead C:\Users\Autouser\Appdata\Roaming\Python\site-packages
Path:
C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts\;C:\Python26\;C:\Python26\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;
Python version:
python --version
Python 2.7.13
Pip version:
python -m pip --version
Pip version: pip 9.0.1 from C:\Python27\lib\site-packages (python 2.7)
Upvotes: 22
Views: 36932
Reputation: 807
CMD Prompt non-administrator, installed for current user:
Location: C:\Users\myuser\AppData\Roaming\Python\Python311\Scripts
CMD Prompt as ADMINISTRATOR, installed for all users:
C:\Program Files\Python\Scripts
Upvotes: 0
Reputation: 2027
Unfortunately I had to fix the problem in production quickly, so I gave up and installed it without the --user option to c:/python27/... directory. I guess one of @DeltaMarine101 suggestions would help.
Upvotes: -3
Reputation: 753
You can try setting the install target with the --target
option like so:
pip install --target=C:\Users\Autouser\Appdata\Roaming\Python\site-packages package_name
If that doesn't work, another option is to try using --install-option
like this:
pip install --install-option="--prefix=$PREFIX_PATH" package_name
Finally, if all else fails, here's one more way to do it:
PYTHONUSERBASE=/path/to/install/to pip install --user
You can specify which python version to install the package for by using python2.x -m pip install ...
Hopefully one of these helps you! :)
Upvotes: 10