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)
Here you can see that the location field says the package is installed at /usr/local/lib/python3. 8/site-packages. The location obviously depends on your system and Python version.
pip when used with virtualenv will generally install packages in the path <virtualenv_name>/lib/<python_ver>/site-packages .
Passing the --user option to python -m pip install will install a package just for the current user, rather than for all users of the system.
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! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With