php - Running python script in Laravel with symfony gives error "Python is not recogninzed as interal or external command"
one text
I am trying to execute a python script in Laravel using Symfony.
I got this error. I have tried :
$process = new Process(['...'], null, ['ENV_VAR_NAME' => 'value']);
The ENV_VAR_NAME
value is set to my python 39 directory.
I'm on windows. Can anybody help me with this?
I've tried this,
$process = new Process(['python', 'top_movies.py'],null,['ENV_VAR_NAME' => 'C:\Users\hrish\AppData\Local\Programs\Python\Python39']); $process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
$ar = $process->getOutput();
Source