Every Python developer eventually learns this lesson the hard way: Never install everything globally. Virtual environments exist for a reason. They allow you to: • isolate dependencies • avoid version conflicts • keep projects reproducible Example workflow: python -m venv venv source venv/bin/activate pip install -r requirements.txt Without virtual environments, Python projects quickly turn into dependency chaos. With them, your environment becomes predictable. And predictable systems are easier to maintain.
I would add: "Always use strict pinning (package==version). Not just in packages, but everywhere". I once had a Postgres container built off a newer image without my knowledge. It wasn't fun to debug why DB just stopped working all of sudden.
Great point about virtual environments! In my experience working with Django and FastAPI projects, I always pair venv with a well-structured requirements.txt split into base, dev, and production files. This helps avoid installing unnecessary dev dependencies in production. Another thing worth mentioning is using pip-compile from pip-tools — it generates pinned requirements automatically, so you get both reproducibility and easy updates when needed.