Python pdb and Breakpoint Cheat Sheet/Route breakpoint() to pdb.set_trace

Set an explicit hook from the environment.

Section: Starting the Debugger

Route breakpoint() to pdb.set_trace

bash
bash
PYTHONBREAKPOINT=pdb.set_trace python app.py

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Starting the Debugger
Start pdb from CLI
Debug a script from the command line.
OpenIn sheetbashsame section
Post-mortem debugging
Inspect the traceback after an exception.
OpenIn sheetpythonsame section
Disable breakpoint() globally
Make breakpoint() a no-op during a run.
OpenIn sheetbashsame section
Run a statement under pdb
Debug an arbitrary statement string.
OpenIn sheetpython1 tag match
Debug a single function call
Run a callable under debugger control.
OpenIn sheetpython1 tag match
Run with custom globals and locals
Control execution namespaces when debugging code strings.
OpenIn sheetpython1 tag match