iPython notebooks and PyCharm have complementary features, so I'm switching a lot from one to the other. But I would like to make the relationship tighter.
For example, when I'm in a notebook and some code blows up, I would like to set a break point in PyCharm, run my code snippet again, and explore the variables in the breakpoint's scope.
At this point, when I'm in this situation I have to either:
This is the main use case I'd like to see solved. Of course, things like triggering PyCharm's "find usages" and "jump to definition" from iPython notebook itself would be a charm (pun not initially intended), but I'll curb my desires for the perfect IDE. For now.
Debug code in Jupyter notebooksSet the breakpoints in the selected cell and press Alt + Shift + Enter for Windows or ⌥⇧↩ for macOS. Alternatively, you can right-click the cell and select Debug Cell from the context menu. The Jupyter Notebook Debugger tool window opens.
The easiest way to debug a Jupyter notebook is to use the %debug magic command. Whenever you encounter an error or exception, just open a new notebook cell, type %debug and run the cell. This will open a command line where you can test your code and inspect all variables right up to the line that threw the error.
PyCharm supports usage of IPython magic commands. Prior to start working, consider the following prerequisites: IPython is available on your computer with Anaconda. The corresponding Conda environment is set as the default interpreter for the current project.
PyCharm 4.0 just came out with iPython integration and allows you to edit *.ipynb files. The official notes are here. Here's how it looks on my screen:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With