If I run pip install
as root, I want it to install into /usr/local
.
This works on some linux systems, but on others it does not.
How can I force pip to install into my desired directory?
A solution using a config file would be preferred to a solution with a command line argument.
You should create config file $HOME/.config/pip/pip.conf and add option:
[global]
target = /usr/local/lib/python2.7/site-packages
And add this directory to your PYTHONPATH if it isn't in. Add to $HOME/.bashrc:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
https://pip.pypa.io/en/latest/user_guide.html#config-file https://pip.pypa.io/en/latest/reference/pip_install.html#cmdoption-t
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