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?

asked Feb 11, 2018 at 0:41
3
  • "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 Commented Feb 11, 2018 at 9: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. Commented Feb 11, 2018 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? Commented Feb 11, 2018 at 17:50

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.