I installed python, numpy, scipy as super user in server and I can import them without any errors. However, standard users (who connect with ssh) can not import them.
How to fix it so that standard users can import them?
Thanks.
2 Answers
this sounds like your $PATH isn't pointing to those executables.
try running the following as root and then as as user
echo $PATH
which python
echo $PYTHONPATHthis will tell you which python installation you are using and where it is looking for installed python files.
It sounds like your user accounts are not pointing at the same python setup. Its best with python to only use root to update the system packages as most distros require specific python versions for some of their internal tools.
Have a look at Virtualenv installations for your user accounts , this way you can have a custom setup for each user that will not conflict, its also easier to migrate that user to other machines as the python setup will be entirely in its homedir.
2I am assuming that since you are running Ubuntu, your standard users' OS has Python installed or that the users can install Python if it is not already installed. Add the import paths for numpy and scipy on the server at the beginning of your Python script,
import sys
sys.path.append("/path/to/numpy")
import numpy
sys.path.append("/path/to/scipy")
import scipy 3