3

I want to be able to graph using Matplotlib in Jython so that I can use ABAGAIL inside of Python.

ABAGAIL: https://github.com/pushkar/ABAGAIL

Jython does not seem to support Matplotlib. But I found the following idea on how to call Python inside of Jython: Invoking Jython from Python (or Vice Versa)

Unfortunately, I can't get the code they suggest to work:

import execnet

gw = execnet.makegateway("popen//python=python")
channel = gw.remote_exec("""
    from numpy import *
    a = array([2,3,4])
    channel.send(a.size)
""")

for item in channel:
    print item

The main problem is that python=python doesn't work. What I'm not understanding is how to actually specify the version of python (anaconda, actually) on my Windows 10 system. What do I need to setup?

Also, is there an alternative package besides matplotlib I can use with Jython to create graphs?

Bruce Nielson
  • 753
  • 8
  • 23
  • "python=python doesn't work" is a bit vague. But try to specify the full path. I don't know where Anaconda gets installed, but something like this: `popen//python=C:/Python27/python` – mzjn Feb 11 '18 at 09:11
  • The python=python was the example I was using to start with. All documentation I find uses something like that, or maybe python=pythin2.7 instead. But I've tried all variant. I also tried with a path like you showed and the "/" just got dropped and it didn't understand what I was specifying. I also tried it with "//" instead (escape character) and had the same effect. That's why I find this all so confusing. – Bruce Nielson Feb 11 '18 at 17:37
  • I'm also on Windows 10 (standard CPython, not Anaconda) and it works for me with `popen//python=C:/Python27/python` or `popen//python=python` (C:/Python27 is in my PATH). How do you know that 'the "/" just got dropped'? Do you get any error messages? – mzjn Feb 11 '18 at 17:50

0 Answers0