Is it possible to hit graphical breakpoints when running codes in PyCharm's IPython console?
i.e.:
As suggested by @bvanlew in comments, PyCharm (both community and professional edition) now supports attaching debugger onto interactive console. Click the debug button as shown below, and PyCharm's debugger will kick in when the breakpoint is hit.
Yes, it is. But it is not automatic.
(Using 4.5.2, Windows 8)
I run an IPython Notebook, and let PyCharm kick off the notebook backend.
I hit Tools, Attach to Process and attempt to identify the PID of the notebook process. I'm yet to find a smooth way of doing this. Currently I use Process Explorer, find the pycharm entry, and watch for the new sub-processes after the notebook server starts. You want the leaf python.exe process, e.g:
6268 pycharm.exe
1235 python.exe (new when notebook launched)
7435 conhost.exe (new)
9237 python.exe (new - pick this PID)
I can now run a cell and hit the graphical breakpoints.
Enjoy.
On ubuntu i had to change the line kernel.yama.ptrace_scope = 1
in /etc/sysctl.d/10-ptrace.conf
to kernel.yama.ptrace_scope = 0
otherwise pycharm was not able to attach to the ipython process.
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