Help

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help

Viviana Beltran
Hi, i m using the Jython Object in an application in java because i needed to read data in h5 format, but this is not avalaible now, and i don't understand how to use my python local installation, i tried to setup in my java class:
Properties props = new Properties();
props.setProperty("python.path", "/home/user/.localpython/lib/:/home/user/jythonI/Lib");
PythonInterpreter.initialize(System.getProperties(), props,new String[] {""});
But this is not working.
I installed the jython library in my home too and setup the variable /home/user/jythonI/Lib in my path, but it still doesn't work.
I tried to install the module h5py separately and got no solution.

I just do this:
java -jar jython_installer-2.5.2.jar
and it finished successfully.
And i add the jar file in my java application(i don't know if both things are necesary).
When the java class reach the line:
interpreter.exec("import h5py");
I got the error: ImportError: No module named h5py, how can i add this module to my java class ???


Thanks for your help.



------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: Help

Stefan Richthofer
I think h5py won't work with Jython because it contains native C-code, i.e. is a CPython specific extension (and afaIk has even additional dependencies to other native extensions like numpy: http://gentoobrowse.randomdan.homeip.net/package/dev-python/h5py).
 
Until JyNI is working sufficiently (won't be available for Jython 2.5 though), I suggest to use the hdf5 Java bindings from Jython. You can get them here: http://www.hdfgroup.org/products/java/
 
- Stefan
 
 
Gesendet: Freitag, 29. August 2014 um 08:10 Uhr
Von: "Viviana Beltran" <[hidden email]>
An: [hidden email]
Betreff: [Jython-users] Help
Hi, i m using the Jython Object in an application in java because i needed to read data in h5 format, but this is not avalaible now, and i don't understand how to use my python local installation, i tried to setup in my java class:
Properties props = new Properties();
props.setProperty("python.path", "/home/user/.localpython/lib/:/home/user/jythonI/Lib");
PythonInterpreter.initialize(System.getProperties(), props,new String[] {""});
But this is not working.
I installed the jython library in my home too and setup the variable /home/user/jythonI/Lib in my path, but it still doesn't work.
I tried to install the module h5py separately and got no solution.
 
I just do this:
java -jar jython_installer-2.5.2.jar
and it finished successfully.
And i add the jar file in my java application(i don't know if both things are necesary).

When the java class reach the line:
interpreter.exec("import h5py");
I got the error: ImportError: No module named h5py, how can i add this module to my java class ???

 
Thanks for your help.

 
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/_______________________________________________ Jython-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/jython-users

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: Help

Stefan Richthofer
In reply to this post by Viviana Beltran
>Well, i used it, but hdf5 for java doesn't work with huge datasets
Is this due to Java's array-indexing limitation, i.e. only 32bit integers can be used to address array-indices?
Or is this due to other constraints?
If it is the former one, I think Jython would inherit the 32bit index issue from Java no matter
what you do, so would not be suitable for your purpose anyway, even with JyNI.
 
That said/asked, you might want to take a look at JPY:
 
or at JEPP:
 
- Stefan
 
Gesendet: Freitag, 29. August 2014 um 16:01 Uhr
Von: "Viviana Beltran" <[hidden email]>
An: "Stefan Richthofer" <[hidden email]>
Betreff: Re: [Jython-users] Help
Well, i used it, but hdf5 for java doesn't work with huge datasets, for that reason i change to python.
I tried using this:
Process process = Runtime.getRuntime().exec("python SomePythonProgram.py hello");BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
System.out.println(reader.readLine())
reader.close()

 
But, process.getInputStream()) doesn't take the entire exit of my script.py, only what it can print in the console.
Do you know other way, in which i can receive data from a python script?
 
Best.
Viviana
 
On 29 August 2014 06:46, Stefan Richthofer <[hidden email]> wrote:
I think h5py won't work with Jython because it contains native C-code, i.e. is a CPython specific extension (and afaIk has even additional dependencies to other native extensions like numpy: http://gentoobrowse.randomdan.homeip.net/package/dev-python/h5py).
 
Until JyNI is working sufficiently (won't be available for Jython 2.5 though), I suggest to use the hdf5 Java bindings from Jython. You can get them here: http://www.hdfgroup.org/products/java/
 
- Stefan
 
 
Gesendet: Freitag, 29. August 2014 um 08:10 Uhr
Von: "Viviana Beltran" <[hidden email]>
An: [hidden email]
Betreff: [Jython-users] Help
Hi, i m using the Jython Object in an application in java because i needed to read data in h5 format, but this is not avalaible now, and i don't understand how to use my python local installation, i tried to setup in my java class:
Properties props = new Properties();
props.setProperty("python.path", "/home/user/.localpython/lib/:/home/user/jythonI/Lib");
PythonInterpreter.initialize(System.getProperties(), props,new String[] {""});
But this is not working.
I installed the jython library in my home too and setup the variable /home/user/jythonI/Lib in my path, but it still doesn't work.
I tried to install the module h5py separately and got no solution.
 
I just do this:
java -jar jython_installer-2.5.2.jar
and it finished successfully.
And i add the jar file in my java application(i don't know if both things are necesary).

When the java class reach the line:
interpreter.exec("import h5py");
I got the error: ImportError: No module named h5py, how can i add this module to my java class ???

 
Thanks for your help.

 
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/_______________________________________________ Jython-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/jython-users

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users