[Linux, Ubuntu]: Running a Python script with different users leads to different types of behavior

I am trying to execute a script in Ubuntu using Python with my user "ubuntu". This is an Amazon virtual machine, so I'm trying to execute this code

$execQuery = "python script.py";
exec($execQuery, $output, $return);

executing this command with ubuntu , the results are OK , but executing it with PHP (which user is www-data strong>), I get:

ImportError: no module named skimage.io

So, I think there is an error in the resolution, but since I have never used Python, I do not know where I need to put the correct permissions.

Does anyone have a clue?

Many thanks.


I tried to use pip install ___ --user www-databut did not work.

+4
1

, , , www-data​​strong > .

, , Python sckit-, , . , www-data​​strong > , $PYTHONPATH, y script :

import sys
sys.path.insert(0, "path/to/python");

.

scikit. scipy, gfortran.

sudo apt-get install gfortran scipy scikit-image .

0

All Articles