Exception during numpy import
Pradeep Badiger <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <DDFE6B42B194104F903A334F685DC8990950D9@mbx025-wd-ca-2.exch025.domain.local> |
Hi,
I am trying to import numpy (1.9.1 for python 2.7) package in a jython script and this script is executed using jython-standalone (v 2.7-b1) APIs.
I have set the path to numpy by setting the properties in PythonInterpreter
Properties props = new Properties();
props.setProperty("python.path", "C:\\Python27\\Lib\\site-packages");
PythonInterpreter.initialize(System.getProperties(), props, new String[] {""});
I am getting following exception while evaluating the script.
javax.script.ScriptException: SyntaxError: 'import *' not allowed with 'from .' in C:\Python27\Lib\site-packages\numpy\__init__.py at line number 182 at column number 4
at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:190)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at com.fico.dmip.scriptjs.PythonScriptExecutor.<init>(PythonScriptExample.java:68)
at com.fico.dmip.scriptjs.PythonScriptExample.main(PythonScriptExample.java:50)
Also I tried with jython-standalone-2.7.b3 and it gave me a different exception.
console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
javax.script.ScriptException: ImportError: No module named type_check in <script> at line number 3
at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:202)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at com.fico.dmip.scriptjs.PythonScriptExecutor.<init>(PythonScriptExample.java:68)
at com.fico.dmip.scriptjs.PythonScriptExample.main(PythonScriptExample.java:50)
Can someone help me on which version of numpy is supported with the release of jython?
Thanks,
Pradeep V.B.
This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jython-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev