You can always add this in any cell:
import pdb; pdb.set_trace()
and the debugger will stop on that line. For example:
In[1]: def fun1(a):
def fun2(a):
import pdb; pdb.set_trace() # debugging starts here
return fun2(a)
In[2]: fun1(1)