from IPython.core.debugger import Pdb; #Insert the above line wherever you want to add the breakpoint Pdb().set_trace()