impossible to launch a script

14 views
Skip to first unread message

Sylvain Ard

unread,
Jan 17, 2021, 10:38:34 AMJan 17
to Anaconda - Public

Hello all !
I have installed anaconda on a web server and want to launch a sh script in php, this script launch a python file
this is the script :
eval "$(conda shell.bash hook)"
conda activate semantic2
pip freeze
"/home/reveries/anaconda3/envs/semantic2/bin/python3.8" "test_petiole.py"
but I have the "conda not found" error, I tried a lot of things without success, please help me !
Best regards

Sylvain Ard

unread,
Jan 17, 2021, 10:48:56 AMJan 17
to Anaconda - Public, Sylvain Ard
I precise that I can launch conda command in a putty shell and that the sh script works when lauched in a putty shell, it's only when it is lauched by PHP that it doesn't works

Sylvain Ard

unread,
Jan 17, 2021, 10:51:59 AMJan 17
to Anaconda - Public, Sylvain Ard
I think that the user of the web server (reveries) who has anaconda is not the same that those who have PHP

Sylvain Ard

unread,
Jan 17, 2021, 11:20:59 AMJan 17
to Anaconda - Public, Sylvain Ard
when I do :
/home/reveries/anaconda3/etc/profile.d/conda.sh

conda activate semantic2
pip freeze
"/home/reveries/anaconda3/envs/semantic2/bin/python3.8" "test_petiole.py"
I have a permission denied !

Sylvain Ard

unread,
Jan 17, 2021, 11:27:28 AMJan 17
to Anaconda - Public, Sylvain Ard
I have do a chmod -R 777 on /home/reveries/anaconda3/  but get "conda not found" with the last script

Sylvain Ard

unread,
Jan 17, 2021, 1:40:24 PMJan 17
to Anaconda - Public
I finally succeeded by doing source /var/www/html/.bashrc in Putty and my final script is :
export PATH="/home/reveries/anaconda3/bin:$PATH"
. "/home/reveries/anaconda3/etc/profile.d/conda.sh"
eval "$(conda shell.bash hook)"
conda init bash
conda activate semantic2
"/home/reveries/anaconda3/envs/semantic2/bin/python3.8" "test_petiole.py"
Sylvain Ard
0549507724
0778380991
Entreprise individuelle SIRET : 80079243400022
Appt 26 Bât A Résidence Le Patio
83 rue de la Bugellerie
86000 Poitiers

Reply all
Reply to author
Forward
0 new messages