java using jython has wrong python version -
im trying use java run python function through jython.jar. i'm using python module downloaded web needs python 2.6 or higher. i'm pretty sure python version 2.7.2. however, when try run java program, continues report python 2.5 detected. how can resolve this?
my code is:
public class main { /** * @param args command line arguments */ public static void main(string[] args) { ... //cmd string command = "\"xml\\" + name2 + "\""; pythoninterpreter python = new pythoninterpreter(null, new pysystemstate()); pysystemstate sys = py.getsystemstate(); sys.path.append(new pystring("c:\\python27\\lib\\site-packages")); python.execfile("work1.py"); } } } }
and error is:
exception in thread "main" traceback (most recent call last): file "work1.py", line 8, in <module> import networkx nx file "c:\python27\lib\site-packages\networkx\__init__.py", line 39, in <module> raise importerror(m % sys.version_info[:2]) importerror: python version 2.6 or later required networkx (2.5 detected). java result: 1
you need use jython 2.7b3, 2.7 beta adds language compatibility cpython 2.7... http://comments.gmane.org/gmane.comp.lang.jython.devel/6145
2.7 beta 4 come in july , after feature freeze. suggest join python-dev mailing list stay aware of new releases. hope helps
Comments
Post a Comment