2

When debugging a .py file within pycharms debug mode i can interact using a python prompt when hitting a breakpoint. Is there any way to use the current state of pycharm within a jupyter notebook istead of the python prompt?

It would make debugging quite a bit easier since you could reuse code snippets for debugging purposes.

I couldn't find anything about it, but for me it feels like it could be a thing.

Thanks for any help!

SyntaxError
  • 330
  • 3
  • 16
  • 1
    Possible duplicate of [What is the right way to debug in iPython notebook?](https://stackoverflow.com/questions/32409629/what-is-the-right-way-to-debug-in-ipython-notebook) – ibarrond Jun 04 '19 at 12:56
  • 2
    I don’t believe it is a duplicate. IIUC, the user wants to debug the current state of the interpreter of pycharm within Jupyter. Is that correct @SyntaxError? – cwalvoort Jun 04 '19 at 16:14
  • @kdq0 exactly! i hope that makes sense – SyntaxError Jun 05 '19 at 11:49

1 Answers1

1

Based on this post, the functionality you are looking for does not exist. The key piece here is that you're trying to import an existing python interpreter into a new IPython kernel. However, from the post linked, you can attach a notebook to an existing IPython kernel with a little bit of work.

A possible solution would be for you to switch to using an IPython interpreter in PyCharm, then attach to that exising kernel in a notebook when needed (as described in the section above).

cwalvoort
  • 1,851
  • 1
  • 18
  • 19