Python Profiling and Troubleshooting Cheat Sheet/Show import statements as they happen

Print detailed import resolution activity.

Section: Startup and Import Troubleshooting

Show import statements as they happen

bash
bash
python -v 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 Startup and Import Troubleshooting
Print site-package configuration
Inspect interpreter paths and site initialization.
OpenIn sheetbashsame section
Save cProfile output to a file
Store profile stats for later analysis.
Show garbage collector stats
Inspect GC activity when memory grows unexpectedly.
Inspect saved profile stats
Read and sort a saved profile run.
Force a garbage collection cycle
Useful for experiments while diagnosing leaks.