How Imports Work — Video Resources¶
Best Single Video¶
Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library by Corey Schafer (22 min) Why: Corey walks through importing your own modules, importing from the standard library, and explains sys.path and how Python finds modules. Methodical, beginner-friendly, and covers the full import workflow from scratch.
Alternatives¶
- Avoiding Import Loops in Python by mCoding (11 min) — Tackles circular imports, a common stumbling block once you start splitting code into multiple files. More intermediate but essential knowledge.
- You should put this in all your Python scripts | if name == 'main' by mCoding (9 min) — Explains the name guard that controls what runs when a file is imported vs executed directly. Short and practical.
Deep Dives¶
- Python Tutorial: Closures - How to Use Them and Why They Are Useful by Corey Schafer (12 min) — While focused on closures, this video demonstrates how Python's module system interacts with scoping and how imports affect variable lookup.
Last verified: February 2026