Installing software in home directory instead of /usr/bin/ in a server

661 views Asked by At

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:

  1. How do I update/install new libraries in my home directory instead of the default /usr/bin/..../ ?
  2. How do I make the software (Python in this case) to understand that I have installed the new library in my home directory ?
1

There are 1 answers

2
markroxor On BEST ANSWER

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/.