Message12852
Hi Team,
I am using Jpython standalone jar to execute webapp on benstalk But its giving me error :
Exception while creating python interpreter: ImportError: Cannot import site module and its dependencies: No module named site
Determine if the following attributes are correct:
* sys.path: [/var/app/current/BOOT-INF/lib/jython-standalone-2.7.1.jar/Lib, __classpath__, __pyclasspath__/]
This attribute might be including the wrong directories, such as from CPython
* sys.prefix: /var/app/current/BOOT-INF/lib/jython-standalone-2.7.1.jar
This attribute is set by the system property python.home, although it can
be often automatically determined by the location of the Jython jar file
You can use the -S option or python.import.site=false to not import the site module
:
Please find my code :
PythonInterpreter pythonInterp = null;
PyObject x = null;
try{
Properties p = new Properties();
p.setProperty("python.path", "/lib/jython-standalone-2.7.1.jar");
PythonInterpreter.initialize(System.getProperties(), p, new String[] {});
pythonInterp = new PythonInterpreter();
}catch(Exception ex){
System.out.println("Exception while creating python interpreter: "+ex.toString());
ex.printStackTrace();
}
System.out.println("Initialed PythonInterpreter in... ");
pythonInterp.exec("print 'Hello Yogita '");
I check by benstalk app .the Jar is at BOOT-INF/lib/jython-standalone-2.7.1.jar & |
|
Date |
User |
Action |
Args |
2019-12-18 08:10:36 | Vikhe | set | recipients:
+ Vikhe |
2019-12-18 08:10:36 | Vikhe | set | messageid: <1576656636.58.0.0699899769375.issue2850@roundup.psfhosted.org> |
2019-12-18 08:10:36 | Vikhe | link | issue2850 messages |
2019-12-18 08:10:36 | Vikhe | create | |
|