17/08/2026
Ever wondered what `-m` ACTUALLY does in Python? 🐍
Most developers use:
python -m venv venv
python -m pip install fastapi
…but rarely stop to understand WHY `-m` is there.
`-m` tells Python to locate a module using its import system and execute it as a script.
And the practical benefit? 🎯
It helps you explicitly tie the operation to the Python interpreter you intended — reducing environment & pip mismatch issues.
For example:
python3.11 -m pip install fastapi
Now you’re saying: “Use Python 3.11’s interpreter to run pip.”
Simple flag. BIG difference. 🔥