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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…