Can PyCharm set breakpoints on ipython notebook?

2019-07-08 09:21发布

问题:

I'd like to know how to set breakpoints in IPython notebook on PyCharm.

If it's possible, please let me know.

回答1:

You must start IPython Notebook from Pycharm's run

  1. Find the IPython path (ex which ipython on linux). Copy the resulting path, we will need it!
  2. On PyCharm go to Run > Edit Configuration > + button on top left most corner (add configuration) > Choose Python. Give your configuration a name.
  3. On the configuration tab, in the Script textbox, paste the path from step 1. On the script, parameters write notebook.
  4. Apply then Ok.

This is essentially like calling ipython notebook from the terminal

Now place your brakepoints and run the notebook from PyCarm (Shift+F10 or click the playbutton).