Having an issue when I try to run a python script via my PHP frontend I've tried both of the following:
$command = "(python3 /my/script.py --params) 2>&1";
$output = shell_exec($command);
and
ob_start();
passthru($command);
$output = ob_get_clean();
Both return:
Traceback (most recent call last): File "/my/script.py", line 14, in from woocommerce import API ModuleNotFoundError: No module named 'woocommerce'
When run through the CLI, the script works just fine, but it throws the above when run through PHP. This is the line in question giving me issues. At a loss as to why it can find the module in one instance and not the other.
from woocommerce import API
from wordpress_json import WordpressJsonWrapper