In a blank Jupyter notebook I enter the following code in a cell:
from IPython.core.debugger import set_trace
set_trace()
print("hello")
After running the cell, I get into debug mode (first screenshot). I want to step to the next line, so I use the command n(ext), as I do in pdb. But then I don't step to the print command, as I expected, but to some internal IPython code (second screenshot). How can I go to the next line in the cell code?
EDIT: As suggested by one answer, I substitute set_trace()
with breakpoint()
, but the result is still the same.