I'm having a puzzling problem when trying to import a module in python only when the script is called from php via system or exec.
From the python shell:
import igraph #This works.
if the previous line was in a file, say, test_module.py, then:
python test_module.py in the bash works.
Within PHP:
exec("python test_module.py",$output,$retval) -> fails : $retval = 1.
However, if the script is instead : import math, then this is fine.
Anybody ever dealt with something similar?
import sys; print sys.pathto your script. - jfsimport os, site; print os.environ.get('PYTHONPATH'), site.USER_SITE; help(site)might help also. - jfs