Second PyCharm 4 EAP: IPython notebook, Attach to process and more

Posted on by Dmitry Filippov

Having announced the first Early Access Preview build of PyCharm 4 almost a month ago, today we’re eager to let you know that the second PyCharm 4 EAP build 139.113 is ready for your evaluation. Please download it for your platform from our EAP page.

Just as always, this EAP build can be used for 30 days starting from its release date and it does not require any license.

The most exciting announcement of this fresh preview and the whole upcoming release of PyCharm 4 is that the IPython notebook functionality is now fully supported in PyCharm!
It has been one of the most top voted feature requests in PyCharm’s public tracker for quite a long time and now we’re proud to introduce this brand new integration to you.

Note that the IPython Notebook integration is available in both PyCharm Community Edition and PyCharm Professional Edition.

ipynb

Now with PyCharm you can perform all the usual IPython notebook actions with *.ipynb files. Basically everything that you got used to with the ordinary IPython notebook is now supported inside PyCharm: PyCharm recognizes different types of cells and evaluates them independently. You can delete cells or edit previously evaluated ones. Also you can output matplotlib plots or images:

ipynb2

When editing code inside cells, PyCharm provides well-know intelligent code completion as if it were an ordinary Python file. You can also get quick documentation and perform all other usual actions that can be done in PyCharm.
So with this integration we have great news – now you can get the best of both PyCharm and IPython Notebook using them together!
Please give it a try, and give us your feedback prior to the final release of Pycharm 4.

Stay tuned for future blog posts with detailed descriptions of this great feature!

Introducing a new feature – Attach to process

Another great feature of the second PyCharm 4 preview build is that Pycharm’s debugger can now attach to a process!

Note: the “attach to process” functionality is available in both PyCharm Community Edition and PyCharm Professional Edition

With PyCharm 4 you can now connect a debugger with any running python process and debug in the attached mode. All you need is go to Tools | Attach to Process.
PyCharm will show you the list of running python processes on a system. Just select the one you want to connect to and click OK:

debugger1

From this point you can use the debugger as usual – setting breakpoints, stepping into/over, pausing and resuming the process, evaluating variables and expressions, and changing the runtime context:

debugger

Currently we support the attach to process only for Windows and Linux platforms. Hopefully we’ll add the support for Mac OS with the next EAP.
Also please note that on most Linux machines, attaching to a process is disabled by default. In order to enable it on a system level, please do

 echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

If you want it permanently, please edit /etc/sysctl.d/10-ptrace.conf (works for ubuntu) and change the line:

kernel.yama.ptrace_scope = 1

to read:

kernel.yama.ptrace_scope = 0

Check ptrace configuration for your Linux distribution accordingly.

Better package management

The other good news is the improved package management subsystem. It got smarter and now recognizes unmet package requirements better. It also has a better UI – showing progress on package installation and a Choose Packages to Install dialog:

packmanagement

In case of errors, PyCharm now has better reports that include suggested solutions:

Screenshot from 2014-10-16 20:44:05

Another good thing is that the JSON support now comes bundled with PyCharm 4 in both Community Edition and Professional Edition. That means JSON is now supported on a platform level and has separate code style and appearance settings as well as its own code inspections, etc.:

JSON

And finally one more useful feature that comes from the Intellij platform. The Code Style settings now offers a new option: Detect and use existing file indents for editing (enabled by default):

codestyle

This new option lets Pycharm detect certain Code Style settings (such as Use Tab character and Indent size) in the currently edited file on the fly. It means that even if the file has its code style different from your current settings, they will still be preserved.
Now you don’t need to worry about losing the formatting that is specific to certain files in your project.

That’s not all as this build has many other improvements and bug fixes – for example, improved Django 1.7 code insight. So we urge you to check the fixed issues and compare this build to the previous one!

Please give PyCharm 4 EAP a try before its official release and please report any bugs and feature request to our issue tracker.

Develop with Pleasure!
-PyCharm team

Comments below can no longer be edited.

32 Responses to Second PyCharm 4 EAP: IPython notebook, Attach to process and more

  1. Madis says:

    October 17, 2014

    Just leaving this here: https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection

    Maybe setcap (found in libcap2-bin) could help? Not sure.

  2. alex says:

    October 17, 2014

    What an awesome feature set!

    I have a question, but I fear I already know the answer to.
    Will the attach to process feature work with remote machines like vagrant?

    We love the work pycharm is doing with vagrant with remote interpreter and remote debugging, and this would definitely complete the package.

    Also, will the console debug work remotely at any time? Currently it just ignores directory mappings :/

    • traff says:

      October 20, 2014

      Hi Alex,
      thanks!

      I don’t know if this is the answer you expect, but yes we do plan the feature of attaching to remote process but certainly it won’t get into 4.0.

  3. Philipp Rudiger says:

    October 17, 2014

    Very cool, been hoping for IPython notebook support for a while now.

    I just tried the EAP build on my Linux Mint system and already have some feedback/questions:

    * My code cells are either clipped or squashed, showing only about 1.5 lines of code or taking up about 10% of the width of my window.
    * Code completion allows me to complete global objects like imports for example but seems completely oblivious to the code executed in previous cells.
    * I generate a lot of HTML video and image output, where the data is base64 encoded. This output doesn’t seem to be supported.
    * Regular HTML images are often stretched.
    * Javascript doesn’t seem to be executed.

    So my main question is how much of this basic browser functionality will you support?

    • ktisha says:

      October 20, 2014

      Hi Philipp,

      > My code cells are either clipped or squashed, showing only about 1.5 lines of code or taking up about 10% of the width of my window.
      >Code completion allows me to complete global objects like imports for example but seems completely oblivious to the code executed in previous cells.

      Thanks, we know about this problems and it’ll be resolved in the next EAP.

      > Regular HTML images are often stretched.
      > Javascript doesn’t seem to be executed.

      Unfortunately, PyCharm is a java application. We’re considering implementing different solutions for Java 6 and Java 7 users (Java 7 allows to embed really nice html viewer with proper javascript rendering).

      Stay in touch!

      • Philipp Rudiger says:

        October 20, 2014

        Thanks for your quick reply! I’m very excited for this as it would potentially provide a huge productivity boost for me, so I really hope you manage to invest the time to get everything working before the 4.0 release.

  4. Bastian says:

    October 18, 2014

    Great!

    But… please get rid of Java 6 for OSX.

    • traff says:

      October 20, 2014

      Hi Bastian!
      Now there is a Mac OSX installer with bundled JDK 7.

  5. Sum says:

    October 18, 2014

    Very exited about the support for IPython notebooks. But how do you open one in PY-139.133? When I open .ipynb files I just get raw text, e.g.:
    {
    “metadata”: {
    “name”: “1. Pandas Basics”
    },
    “nbformat”: 3,
    etc.

    • ktisha says:

      October 20, 2014

      Hi Sum,

      please switch to the notebook view at the bottom of editor.

  6. Stefan Foulis says:

    October 18, 2014

    Does attaching to a running process to debug mean it’s possible to debug a python process inside a docker container now? (That would be really awesome 🙂 )

    • Dmitry Filippov says:

      October 21, 2014

      This won’t work in the current version of PyCharm since it doesn’t support remote attachment to a process – only local. However remote attach to a process is on our list for future developments.

  7. Bernd Günther says:

    October 19, 2014

    Attach to process ist really cool, but as far as I can see it only works when the process based on python.exe (in Windows).

    Blender (www.blender.org) has a python build in for scripting. But the attach process window does not find the blener python process. (I use Idea EAP 14 with the python plug in)

  8. Gaëtan de Menten says:

    October 20, 2014

    Very exciting release. The fact that you are working on IPython notebook integration is already very exciting by itself. The current implementation is not so great (see my comments in the issue), but I guess that will change before the final release. The “attach to process” feature seem super cool too (but I haven’t tried it yet).

    • traff says:

      October 30, 2014

      Thanks, Gaëtan!

  9. Sean says:

    October 20, 2014

    This is exciting news. Could you also post some tutorials about how to use notebook with current Pycharm editor? How do they get integrated?

    • Dmitry Filippov says:

      October 20, 2014

      We’ll post some additional materials on IPython notebook integration to this blog soon.

  10. Thomas says:

    October 21, 2014

    Good stuff, please also address the problem how to keep *.ipynb files under version control, see
    http://stackoverflow.com/questions/18734739/using-ipython-notebooks-under-version-control

    • ktisha says:

      October 22, 2014

      Hi Thomas,

      thanks for pointing out!

  11. Francesco Maida says:

    October 23, 2014

    I didn’t noticed it before, but I see that you’re providing two different packages for PyCharm EAP on Mac OS X: with and without JRE 1.7 included.

    What would you recommend to install on a Mac with Yosemite? your version with JRE 1.7 or perhaps you think that it’s better to stay with Apple JRE 1.6 for the moment ?

    Thank you and best regards

    • traff says:

      October 30, 2014

      Hi Francesco,
      on Mac Yosemite we recommend to install PyCharm with bundled JRE.
      It is Java 1.7 for that EAP, but in future we will provide a version with 1.8.

  12. Nicholas Stevenson says:

    October 23, 2014

    Hey Jetbrains, Does anyone know if the ‘Send To Maya’ action plugin was ever integrated or released as an optional download by chance? The last time I saw it mentioned, the plugin was planned to be added to the repository in January of this year. (But this was stated in the 3.1 EAP thread, so quite a long time ago)

    I’m assuming this was abandoned, but just wondering if it’s still being worked on, because it would be very useful if ever made available, even if it was a beta plugin of some sort.

    • traff says:

      October 30, 2014

      Hi Nicholas,
      true, we had plans to release a plugin for Maya and we had already a functionality that enabled adding Maya python interpreter to PyCharm and sending code to Maya and some other fixes regarding resolve and remote debugging.
      But it seemed not enough to name it PyCharm Maya support, so we’ve moved some part of existing support to PyCharm Professional(so since PyCharm 3.1 you can add Maya interpreter to PyCharm and resolve and remote debug works correctly), but ‘Send to Maya action’ didn’t fit there.
      As for now we don’t have any specific plans neither to include it in PyCharm 4.0 nor to release it as a plugin.
      Actually this one(Send to Maya) could be achieved by configuring external tool action.
      If you have any specific requests regarding Maya support in PyCharm please don’t hesitate to report to our tracker and as it becomes more then ‘Send to Maya action’ we’ll consider to develop a proper support for it.

  13. John says:

    October 28, 2014

    So you haven’t fixed any of the remote interpreter bugs, not even the regressions, great work.

    • traff says:

      October 30, 2014

      Hi John,
      we have done a bunch of fixes and probably there will be some more in final PyCharm 4.0 release. But this release is mostly about new features, so stay tuned! We do plan much more remote interpreters bug fixing in subsequent 4.1 update.

  14. Freek says:

    October 31, 2014

    Either I’m having a really bad day, or is the “attach to process” function not available in the community edition at this moment?

    http://goo.gl/riZRCv

  15. Third PyCharm 4 EAP: NumPy array viewer, IPython notebook improvements, and more | JetBrains PyCharm Blog says:

    November 6, 2014

    […] new “Attach to process” feature introduced with the previous build is now available under the Mac OS […]

  16. Mark Horvath says:

    April 24, 2015

    Just tried Attach to Process, attached to an IPython 3.0.0 console running Python 2.7.6. Does work, can stop at breakpoints, pretty cool actually. Unfortunately after issuing “print 1” in the console, up/down/left/right arrows stop working as usual, but print funny characters. Any tips on how to avoid this?

    Seems to work seamlessly with IPython Notebook ran outside PyCharm though. Now I only need a variable editor in for pandas and I’ll be happy forever!

Subscribe

Subscribe for updates