i am trying to run python script from laravel using symfony process. here is my controller
public function test()
{
$process = new Process("C:/Users/faraz/Anaconda3/python C:/xampp/htdocs/fyp_final1/public/temp.py");
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
dump(json_decode($process->getOutput(), true));
}
here is my python script, i placed it in public folder of my project.
import json
data='abc'
print(json.dumps(data))
Error
The command "C:/Users/faraz/Anaconda3/python C:/xampp/htdocs/fyp_final1/public/temp.py" failed. Exit Code: -1073740791(Unknown error) Working directory: C:\xampp\htdocs\fyp_final1\public Output: ================ Error Output: ================ Fatal Python error: failed to get random numbers to initialize Python
how ever when i run it on terminal it works fine.