Jython

Message12852

Author Vikhe
Recipients Vikhe
Date 2019年12月18日.08:10:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576656636.58.0.0699899769375.issue2850@roundup.psfhosted.org>
In-reply-to
Content
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 &
History
Date User Action Args
2019年12月18日 08:10:36Vikhesetrecipients: + Vikhe
2019年12月18日 08:10:36Vikhesetmessageid: <1576656636.58.0.0699899769375.issue2850@roundup.psfhosted.org>
2019年12月18日 08:10:36Vikhelinkissue2850 messages
2019年12月18日 08:10:36Vikhecreate

Supported by Python Software Foundation,
Powered by Roundup

AltStyle によって変換されたページ (->オリジナル) /