using ipdb to debug python code in one cell (jupyter or Ipython)

Had this problem also and it seems to be related to versions of jupyter and ipdb.

Solution is to use this instead of the ipdb library set_trace call:

from IPython.core.debugger import Tracer
Tracer()() #this one triggers the debugger

Source: http://devmartin.com/blog/2014/10/trigger-ipdb-within-ipython-notebook/

Annotated screenshot:
screenshot illustrate how Tracer()() will cause Jupyter notebook to react. It pauses execution on the line in your code where you Trace()() and a new "inline" input accepts ipdb commands like 'p' or 'n' or 'c', shown here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)