i'm working on a project using python and php, now when i run python on my mac terminal it runs perfect but when i try execute a command from my php on my localhost or live server it keep giving me this error below...can some one with me some tips on how to install python modules on a server using ssh or any other way.. thank you in advance!
Traceback (most recent call last):
File "demo.py", line 7, in <module>
import requests
ImportError: No module named requests
here is my php code...
$data = "hello world";
$cmd = "/usr/bin/python demo.py '$data' 2>&1";
$response = shell_exec($cmd);
According to the official support article from Hostgator, requests module is not currently installed on all Linux servers. That is why import requests
doesn't work. Installing modules by users is not allowed on Hostgator shared servers, so we could not use modules not installed.
Reference: http://support.hostgator.com/articles/hosting-guide/hardware-software/python-modules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With