I'm running my Python codes in a server to which I have been connected via ssh. I would like to however, update/install few external libraries for Python.
Since I am not the sudo user, I am not able to do the usual
pip install ....
as I get the error, for example when I tried installing pyfits
:
error: could not create '/usr/lib64/python2.7/site-packages/pyfits': Permission denied
Now, there are two questions, for which I have been trying to find answers for:
- How do I update/install new libraries in my home directory instead of the default /usr/bin/..../ ?
- How do I make the software (Python in this case) to understand that I have installed the new library in my home directory ?
To install modules in your HOME directory -
pip install --user $PACKAGE_NAME
should do the trick.
This will install package in $HOME/.local/bin/$PACKAGE and the rest of package in $HOME/.local/lib/pythonx/site-packages/.