‘python3’ is not recognized as an internal or external command, In Laravel using Symfony/process

I’m trying to execute a python file in laravel controller using symfony/process but i get an error.

Exit Code: 1(General error)

Output:
================
'python3' is not recognized as an internal or external command,
 operable program or batch file.

This is my code

use SymfonyComponentProcessProcess;
use SymfonyComponentProcessExceptionProcessFailedException;


$process = new Process(['python3','../python/data.py']);
        $process->run();
        if (!$process->isSuccessful()) {
            throw new ProcessFailedException($process);
        }

I already have python3 installed and that’s working fine in command line.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *