installing numpy in jython (in Netbeans)
Being a newbie to this list, I recognize that the answer to this might be "why would you do that?". But surely it can't be worse than that. Briefly put, I want to install numpy and scipy in jython (reasons below). Running 'cd <jython distro>; jython setup.py install' runs into errors. But installing he same distro under python works fine. So the underlying question is: is there a way to install numpy under jython? Here's how I got here. The reason I would like this under jython is wrapped up in Netbeans, Octave, Matlab and Windows 7. I've been using Netbeans under linux for years for c++ and a bit of Java, and the editing environment with cross referencing and syntax-directed editing is quite good. Netbeans only presents python debugging via jython, which makes sense. Most of the work I am doing is with matrix algebra and I started with Octave, but while Octave is excellent for operating on matrices, it is not good for file format manipulations, hence for some operations I'd like to turn to python, and if I edit under Netbeans, the debugging requires that I install numpy under jython. At work I use a machine running fedora 16 .... but... I travel a bit and my travel machine is a laptop running windows 7. Therefore, Windows 7 + Netbeans + numpy + debugging ==> jython + numpy + scipy. Here's the install problems, which occur under numpy-1.7.0b1 and 1.6.2. The first install error is in numpy\distutils\exec_command.py, line 585, where it throws an exception because the java exec tests are unlimited. So I comment out those two lines, and rerun the setup.py. The next errors are notes about features not being available because other packages are also unavailable. I don't think this is really getting in the way, although I could be wrong. The libraries mentioned as missing are: * libraries mkl,vml,guide * libraries ptf77blas,ptcblas,atlas * libraries lapack_atlas So setup gets as far as this: running install running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building py_modules sources creating build creating build\src.java1.6.0_33-2.5 creating build\src.java1.6.0_33-2.5\numpy creating build\src.java1.6.0_33-2.5\numpy\distutils building library "npymath" sources No module named jythoncompiler in numpy.distutils; trying from distutils customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 don't know how to compile Fortran code on platform 'java' Some of these messages make it look as if the config wants to use the cygwin gnu compilers, which are ok, but under windows are not nearly as good as mingw gnu compiler or better yet, the visual studio 2010 compiler. I have both, but I don't see a way to steer the numpy setup to use them. The next error is fatal File "...\numpy-1.7.0b1\numpy\distutils\ccompiler.py", line 111, in CCompiler_object_filenames if ext not in self.src_extensions: TypeError: 'NoneType' object is not iterable This one looks as if it does not know what .o or .a or .obj files are. Fixing this one looks like hours of digging through the code. Is there a simpler solution? Thanks in advance, Todd
Todd, The short version is: you can't do that. -- Jython uses the JVM, numpy is very, very tied into the CPython runtime. This thread is a bit old, but think still holds: http://stackoverflow.com/questions/3097466/using-numpy-and-cpython-with-jyth... There is the junumeric project, but it doesn't look very active: https://bitbucket.org/zornslemon/jnumeric-ra/downloads/ According to the Jython FAQ (http://wiki.python.org/jython/JythonFaq/GeneralInfo): "For the next release of Jython, we plan to support the C Python Extension API" -- not sure what the timing is on that, but in theory, you could then use numpy ,but numpy is a pretty complex beast -- I wouldn't recommend being the first to try it! So: other options: 1) A couple years ago the NetBeans team was talking about improving the support for Python (CPython) -- you might want to see if there is a plugin or something that you could add. Maybe this: http://wiki.netbeans.org/Python 2) Python programming can be pretty darn productive with "print" debugging -- a lot of us never use a "proper" debugger -- a good programmers editor and a console is all you need. 3) There are a lot of good IDEs for CPython -- and stad-alone debuggers (WinPdb, for example), so you don't need to be married to the NetBeans environment. In short: It'll probably be a lot easier to find a different programming (or debugging anyway) )environment than get numpy to work work with Jython. -Chris On Sun, Aug 26, 2012 at 4:36 PM, Todd Brunhoff <toddb@nvr.com> wrote:
Being a newbie to this list, I recognize that the answer to this might be "why would you do that?". But surely it can't be worse than that.
Briefly put, I want to install numpy and scipy in jython (reasons below). Running 'cd <jython distro>; jython setup.py install' runs into errors. But installing he same distro under python works fine. So the underlying question is: is there a way to install numpy under jython?
Here's how I got here. The reason I would like this under jython is wrapped up in Netbeans, Octave, Matlab and Windows 7. I've been using Netbeans under linux for years for c++ and a bit of Java, and the editing environment with cross referencing and syntax-directed editing is quite good. Netbeans only presents python debugging via jython, which makes sense. Most of the work I am doing is with matrix algebra and I started with Octave, but while Octave is excellent for operating on matrices, it is not good for file format manipulations, hence for some operations I'd like to turn to python, and if I edit under Netbeans, the debugging requires that I install numpy under jython. At work I use a machine running fedora 16 .... but... I travel a bit and my travel machine is a laptop running windows 7. Therefore, Windows 7 + Netbeans + numpy + debugging ==> jython + numpy + scipy.
Here's the install problems, which occur under numpy-1.7.0b1 and 1.6.2. The first install error is in numpy\distutils\exec_command.py, line 585, where it throws an exception because the java exec tests are unlimited. So I comment out those two lines, and rerun the setup.py.
The next errors are notes about features not being available because other packages are also unavailable. I don't think this is really getting in the way, although I could be wrong. The libraries mentioned as missing are:
libraries mkl,vml,guide libraries ptf77blas,ptcblas,atlas libraries lapack_atlas
So setup gets as far as this:
running install running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building py_modules sources creating build creating build\src.java1.6.0_33-2.5 creating build\src.java1.6.0_33-2.5\numpy creating build\src.java1.6.0_33-2.5\numpy\distutils building library "npymath" sources No module named jythoncompiler in numpy.distutils; trying from distutils customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 don't know how to compile Fortran code on platform 'java'
Some of these messages make it look as if the config wants to use the cygwin gnu compilers, which are ok, but under windows are not nearly as good as mingw gnu compiler or better yet, the visual studio 2010 compiler. I have both, but I don't see a way to steer the numpy setup to use them.
The next error is fatal
File "...\numpy-1.7.0b1\numpy\distutils\ccompiler.py", line 111, in CCompiler_object_filenames if ext not in self.src_extensions: TypeError: 'NoneType' object is not iterable
This one looks as if it does not know what .o or .a or .obj files are. Fixing this one looks like hours of digging through the code. Is there a simpler solution?
Thanks in advance,
Todd
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
1) [NetBeans support for CPython] -- Maybe this: http://wiki.netbeans.org/Python That seems outdated. I had used http://wiki.netbeans.org/PythonInstall which points at a plugin repository which does pretty good install. But of course it is jython, not python. And the Hudson (Jenkins) build was last done Oct 22, 2010. And interestingly enough, that info points back to the link you found. Oh well. 2) Python programming can be pretty darn productive with "print" debugging Works for me. And sometimes there *is* no other way. 3) There are a lot of good IDEs for CPython -- and stad-alone debuggers (WinPdb, for example), so you don't need to be married to the NetBeans environment. winpdb is ok, although it is only a graphic debugger, not an ide, emphasis on the 'd'. As it is, since NB cannot debug python that requires numpy, it means I must rely on vi & Netbeans for editing and winpdb for debugging. I don't think about the ide's as being married to
Chris, I appreciate the pointers, which appear to confirm that numpy and jython are a ways out. I can see where the c-api support in jython would be required by numpy's implementation. them, but I do like to use the best tools available. NB could be, but is not for python. Thanks again for helping to shorten my search for tools. Todd On 8/26/2012 5:55 PM, Chris Barker wrote:
Todd,
The short version is: you can't do that. -- Jython uses the JVM, numpy is very, very tied into the CPython runtime.
This thread is a bit old, but think still holds:
http://stackoverflow.com/questions/3097466/using-numpy-and-cpython-with-jyth...
There is the junumeric project, but it doesn't look very active:
https://bitbucket.org/zornslemon/jnumeric-ra/downloads/
According to the Jython FAQ (http://wiki.python.org/jython/JythonFaq/GeneralInfo): "For the next release of Jython, we plan to support the C Python Extension API" -- not sure what the timing is on that, but in theory, you could then use numpy ,but numpy is a pretty complex beast -- I wouldn't recommend being the first to try it!
So: other options:
1) A couple years ago the NetBeans team was talking about improving the support for Python (CPython) -- you might want to see if there is a plugin or something that you could add. Maybe this: http://wiki.netbeans.org/Python
2) Python programming can be pretty darn productive with "print" debugging -- a lot of us never use a "proper" debugger -- a good programmers editor and a console is all you need.
3) There are a lot of good IDEs for CPython -- and stad-alone debuggers (WinPdb, for example), so you don't need to be married to the NetBeans environment.
In short: It'll probably be a lot easier to find a different programming (or debugging anyway) )environment than get numpy to work work with Jython.
-Chris
On Sun, Aug 26, 2012 at 4:36 PM, Todd Brunhoff<toddb@nvr.com> wrote:
Being a newbie to this list, I recognize that the answer to this might be "why would you do that?". But surely it can't be worse than that.
Briefly put, I want to install numpy and scipy in jython (reasons below). Running 'cd<jython distro>; jython setup.py install' runs into errors. But installing he same distro under python works fine. So the underlying question is: is there a way to install numpy under jython?
Here's how I got here. The reason I would like this under jython is wrapped up in Netbeans, Octave, Matlab and Windows 7. I've been using Netbeans under linux for years for c++ and a bit of Java, and the editing environment with cross referencing and syntax-directed editing is quite good. Netbeans only presents python debugging via jython, which makes sense. Most of the work I am doing is with matrix algebra and I started with Octave, but while Octave is excellent for operating on matrices, it is not good for file format manipulations, hence for some operations I'd like to turn to python, and if I edit under Netbeans, the debugging requires that I install numpy under jython. At work I use a machine running fedora 16 .... but... I travel a bit and my travel machine is a laptop running windows 7. Therefore, Windows 7 + Netbeans + numpy + debugging ==> jython + numpy + scipy.
Here's the install problems, which occur under numpy-1.7.0b1 and 1.6.2. The first install error is in numpy\distutils\exec_command.py, line 585, where it throws an exception because the java exec tests are unlimited. So I comment out those two lines, and rerun the setup.py.
The next errors are notes about features not being available because other packages are also unavailable. I don't think this is really getting in the way, although I could be wrong. The libraries mentioned as missing are:
libraries mkl,vml,guide libraries ptf77blas,ptcblas,atlas libraries lapack_atlas
So setup gets as far as this:
running install running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building py_modules sources creating build creating build\src.java1.6.0_33-2.5 creating build\src.java1.6.0_33-2.5\numpy creating build\src.java1.6.0_33-2.5\numpy\distutils building library "npymath" sources No module named jythoncompiler in numpy.distutils; trying from distutils customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 don't know how to compile Fortran code on platform 'java'
Some of these messages make it look as if the config wants to use the cygwin gnu compilers, which are ok, but under windows are not nearly as good as mingw gnu compiler or better yet, the visual studio 2010 compiler. I have both, but I don't see a way to steer the numpy setup to use them.
The next error is fatal
File "...\numpy-1.7.0b1\numpy\distutils\ccompiler.py", line 111, in CCompiler_object_filenames if ext not in self.src_extensions: TypeError: 'NoneType' object is not iterable
This one looks as if it does not know what .o or .a or .obj files are. Fixing this one looks like hours of digging through the code. Is there a simpler solution?
Thanks in advance,
Todd
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sun, Aug 26, 2012 at 8:53 PM, Todd Brunhoff <toddb@nvr.com> wrote:
Chris,
winpdb is ok, although it is only a graphic debugger, not an ide, emphasis on the 'd'.
yup -- I mentioned, that as you seem to like NB -- and I know I try to use the same editor for eveything. But if you want a nice full-on IDE for Python, there are a lot of them. I"m an editor_termal guy, so I can't make a recommendation, but some of the biggies are: Eclipse+PyDev PyCharm WindIDE Spyder (particularly nice for numpy/ matplotlib, etc) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
On 8/27/2012 9:51 AM, Chris Barker wrote:
On Sun, Aug 26, 2012 at 8:53 PM, Todd Brunhoff<toddb@nvr.com> wrote:
Chris, winpdb is ok, although it is only a graphic debugger, not an ide, emphasis on the 'd'. yup -- I mentioned, that as you seem to like NB -- and I know I try to use the same editor for eveything.
But if you want a nice full-on IDE for Python, there are a lot of them. I"m an editor_termal guy, so I can't make a recommendation, but some of the biggies are:
Eclipse+PyDev PyCharm WindIDE Spyder (particularly nice for numpy/ matplotlib, etc) I had not considered these yet, but they look interesting. I ended up here: http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environmen... which compares IDEs for every language, and found a free python plugin for VS 2010 which looks excellent. I may also try Spyder since I would expect you atmospheric guys would know where numericals are well integrated. Thanks.
Todd
-Chris
participants (2)
-
Chris Barker
-
Todd Brunhoff