Debugging functions in scripts when called by PyCharm's Jupyter Notebook editor

已回答

As per the title, when running interactively in the built in Jupyter Notebook editor in PyCharm, is it possible to set breakpoints in external modules contained in separate .py files?.

You can attach the debugger to the interactive python console and set breakpoints in modules that are imported, but it doesn't seem to work the same when using the PyCharm Jupyter Notebook editor.

I'm wondering what I am missing.

Thanks.

0

Hi

>when running interactively in the built in Jupyter Notebook editor

Do you execute cells or run the cell content in the console? Not sure if I got it correctly. In general, PyCharm can't debug Jupyter Notebooks at the moment.

0
Avatar
Permanently deleted user

I'm not trying to debug the notebook itself.

I have the notebook running within PyCharm calling functions in separate .py files.

I want to set a breakpoint within the .py file. Then call the function from the Notebook and then have execution stop in the .py file, not the notebook.

I'm not running the cell content from the console. I'm running it from the actual open notebook.

0

I see, thank you for the clarification. The only way to do it now is to use Debug Server, please see the relevant docs: https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config

0

Using  Jupyter Notebook within pyCharm is slow and experiemental.

I would like individual cell debugging feature while in scientific mode.

Ipython backend provide all the necessary API for this.

Spyder already implemented this feature I want.
https://github.com/spyder-ide/spyder/issues/9361

0

请先登录再写评论。