import module
Import an entire module and access with module.name prefix
import module as alias
Import a module with a shorter name
Module vs Script
Understanding __name__ and "if __name__ == __main__"
What Python looks for
How Python resolves "import foo"
from module import name
Import specific names directly with no prefix needed
!from module import *
Import ALL public names from a module (usually avoid this)
from module import name as alias
Import a name and rename it locally
Import specific class/function
Import from nested modules and subpackages
Package structure basics
How to organize Python code into packages with __init__.py
__init__.py purpose
What goes in __init__.py and why
Namespace packages (no __init__.py)
Python 3.3+ allows packages without __init__.py
Relative import basics
Use . and .. to import from the current or parent package
Dot meanings explained
What . (single dot) and .. (double dot) mean in imports
When to use relative vs absolute
Guidelines for choosing between relative and absolute imports
Importing across sibling folders
Import from a folder at the same level using .. (parent) then down
sys.path explained
The list of directories Python searches for modules
!Modify sys.path
Add directories to the import search path at runtime
PYTHONPATH environment variable
Add import paths via environment variable
pip install -e (editable)
The proper way to make your package importable during development
Conditional imports
Import different modules based on availability or platform
Lazy imports
Delay importing until actually needed (faster startup)
Import ordering (PEP 8)
The standard order for import statements
__all__ for public API
Control what "from module import *" exports
Reload a module
Re-import a module after changing its source code
Importing in test files
How tests/ imports from your src/ package (the #1 beginner question)
ModuleNotFoundError
Python cannot find the module you are trying to import
ImportError: cannot import name
The module exists but the specific name does not
Circular imports
Two modules import each other, causing failures
Relative import errors
Common errors when using . and .. imports
!Shadowing built-in modules
When your file name conflicts with a standard library module