The story behind Jython support in PyCharm

Giacomo Lacava recently wrote a blog post describing his not very good experience with Jython support in PyCharm. I’d like to explain what the situation actually is.

First of all, PyCharm currently supports Python versions starting with 2.4. This means that PyCharm’s own components written in Python use language features of Python 2.3 and 2.4, and simply will not run with Jython 2.2. With Jython 2.5, things like loading the list of library paths and completion for the standard library (which Giacomo had problems with) should work with no problems.

Second, it’s true that we do not support parsing jar files in PyCharm. When PyCharm was initially designed, the Java support in IntelliJ IDEA was a monolithic component, and we had the choice of either including it all or leaving it all out. Including it would mean that we would have a Python IDE that could do, say, an “Introduce Parameter” refactoring for Java but not for Python. Which would be really, really weird. So we decided to leave it all out.

On the other hand, the IntelliJ IDEA Python plugin can rely on the Java support in IntelliJ IDEA itself, and it contains all the necessary logic to support Java/Python interop. The plugin can resolve imports from Python files to Java code, perform cross-language refactorings, auto-import Java classes in Python code, etc. And as far as we know, it provides a better Jython development experience than any other IDE.

The good news is that, since that time, our Java support has become more modular, and now we have the option to include just enough of it in PyCharm to support Java/Python interop but not anything more. Therefore it’s possible that a future version of PyCharm will have the same degree of Jython support as the IntelliJ IDEA Python plugin currently has. However, we’re still not sure if there’s enough of a target audience for this functionality. So if you’d like to have this, please let us know.

This entry was posted in Cool Feature and tagged . Bookmark the permalink.

32 Responses to The story behind Jython support in PyCharm

  1. Sam Hartsfield says:

    I’m working on a Jython project now in PyCharm, and I’d love to have the extra support.

  2. Samuel says:

    I would like too.

  3. Yeah, it would actually be really nice. I’d like to do some Jython projects in PyCharm.

  4. Martin says:

    Proper Jython support in PyCharm would be very much appreciated. Or at the very least, a licence that allows us to run either PyCharm or the IntelliJ IDEA with the Python plugin?

    I assume that RubyMine has the same issue with regard to jRuby, given the reasoning. Given the growing use of jRuby I am picking that extending RubyMine to support jRuby is on the cards. Please make sure that PyCharm adds proper Jython support when this happens…

  5. Roger says:

    I would like to see jython-support in PyCharm as well. The code created would be callable from clojure, too, right?

  6. Alistair Broomhead says:

    I would love to see jython support in PyCharm – this would be great for tools like robotframework which have both a python and jython version, but different plugin support in each. Currently I am dis-incentivised from using the jython version due to a lack of IDE support, which makes little sense to me.

  7. Rob Schroder says:

    +1 on Jython support in PyCharm

  8. Gary says:

    +1 for Jython support in PyCharm. I see Jython as an important tool for Pythonistas (target the JVM and utilise the large collection of Java libraries – how good is that!). At the very least, read-only support for JAR files in PyCharm would be valuable.

  9. naderghanbari says:

    Really promising. PyCharm is definitely the best python IDE and jython support seems to be compulsory for the best python IDE.

  10. Curtis says:

    +1 for Jython support in PyCharm beyond simple runtime support. A lot of enterprise software vendors provide Java APIs which Jython provides a great interface to interact with. Being able to interopt Java from PyCharm will make the experience much richer in these cases and eliminate the need to keep other IDEs around in my case.

  11. Alex says:

    I also echo the need for jar parsing in PyCharm. It’s not practical to have to buy the Ultimate version of IDEA just to use the Python plugin.

  12. Maxim says:

    I would appreciate Jython support in PyCharm!

  13. Paul says:

    +1 for Jython support in PyCharm (jar parsing).

  14. desfrenes says:

    What’s the status on this issue ? I hate those red underlines in my editor: http://postimage.org/image/c4c56otat/

    Do I have to buy IDEA ?

    • Dmitry Jemerov says:

      All that is written in the post is still true. PyCharm does not include any Java support.

      • desfrenes says:

        That’s unfortunate. I don’t mind buying another license to solve this so I downloaded IDEA and the Python plugin to give it a try and I still can’t get completion working although my jars are listed in the project structure/project libraries.

  15. Sayth says:

    +1 for jython support. With the lead developer now paid to work on jython there are 2.7 alphas available already.

  16. Michael Simpson says:

    I would be interested in seeing Jython support with an eye towards allowing me to use PyCharm to write and run Sikuli tests (written in Jython) instead of using the more limited Sikuli IDE.

    • Mike says:

      Have you tried Netbeans? I’m able to include the sikuli jar in netbeans and can code/execute sikuli from the netbeans ide.
      Still, I’d rather do this in intelliJ, the netbeans/sikuli intergration can be squirrley, especially when merging diffs netbeans can inject whitespace!

      So pleas intelliJ team, add jython support.

  17. Yousuf Ahmad says:

    +1 for Jython support in PyCharms, which is definitely the best Python IDE out there. With the expertise of IDEA, this should almost be a given! Great product guys! Make it even better, please!

  18. John McWade says:

    I have at least one project here at work that uses Jython. At least teach Pycharm to parse jars, for starters, so I don’t have so many unresolving references to suppress/ignore.

  19. Definitely a must have …

  20. Daniil says:

    Jython has good from both Java and Python, it will be nice to have robust support for it in addition.

  21. +1 for Jython support – though I can see the rationale for best support in the IntelliJ environment.

  22. Tom says:

    +1 for Jython support

  23. Katalma says:

    +1 for Jython support …

  24. Alex Kotenko says:

    +1 fr Jython. I’ve just started working on a jython project.

  25. ou_ryperd says:

    +1 for more Jython support.
    Love Jython. Love PyCharm.

  26. asyd says:

    Any update on jython support?

  27. Dan Fare says:

    I would love to have Jython support in PyCharm.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">