I'm tring to execute a python script call from php with the command below:
$output = shell_exec('python /var/www/html/sna/server/userManagement.py '. $user.' '. $pass .' \''.$action.'\' 2>&1');But when I execute it I get this
sh: 1: python: not found But python is correctly installed in my env.
If I digit
type -a python I get the path of python in this env like below
python is /home/leonardo/miniconda2/envs/sna/bin/pythonAt the very beginning of the python script I have include
#!/usr/bin/env pythonBut I recieve always the same error. How can I solve ?
21 Answer
Taking the comment of @Anonymous:
Call Python providing the full path (in your virtual environment).
PS: A comment is not an answer. If you search, this question without an answer is less interesting, although it has the answer in its comments. That is why I copied it. All credits go to the other user.