Message12896
Happy Christmas Yogita. I don't know Beanstalk, but your program doesn't reference it and isn't (AFAICT) a servlet. #2844 may be worth a look.
I do not think it is necessary to manipulate python.path as you do, and in any case, it should point to where additional Python code can be found, not the standalone JAR. Try without and see what sys.path ends up as.
However, I'm not getting the same result (Windows 10). With this program:
// Start an interpreter and check the sys.path
import org.python.util.PythonInterpreter;
import java.util.Properties;
public class Issue2850 {
public static void main(String args[]) {
Properties p = new Properties();
//p.setProperty("python.path", "inst\jython-standalone-2.7.1.jar");
PythonInterpreter.initialize(System.getProperties(), p, new String[] {});
PythonInterpreter pythonInterp = new PythonInterpreter();
pythonInterp.exec("import sys");
pythonInterp.exec("print sys.path");
}
}
and the JAR at inst\\jython-standalone-2.7.1.jar I still end up with a sensible sys.path:
PS issue2850> javac -cp "inst\jython-standalone-2.7.1.jar" Issue2850.java
PS issue2850> java -cp ".;inst\jython-standalone-2.7.1.jar" Issue2850
['...\\issue2850\\inst\\Lib', '...\\issue2850\\inst\\jython-standalone-2.7.1.jar\\Lib', '__classpath__', '__pyclasspath__/', '...\\.local\\lib\\jython2.7\\site-packages']
(That last one is in my home directory, but is empty.) Notice Jython looks for a Lib directory next to the JAR (at inst/Lib), as well as inside it. Your path is relatively short but still contains the place I'd expect to find site.py. |
|
Date |
User |
Action |
Args |
2019-12-24 19:59:02 | jeff.allen | set | messageid: <1577217542.04.0.64439930299.issue2850@roundup.psfhosted.org> |
2019-12-24 19:59:02 | jeff.allen | set | recipients:
+ jeff.allen, Vikhe |
2019-12-24 19:59:02 | jeff.allen | link | issue2850 messages |
2019-12-24 19:59:01 | jeff.allen | create | |
|