Stage 1 · Lesson 4 of 10
Modules, virtual environments and pip
In Python, a file of code is a , and a folder of modules is a package. You bring them in with import or from ... import. Other people's packages come from PyPI, the public package , and you install them with or uv.
Install them into a virtual environment (venv), which is a separate folder of packages for each project. That way two projects can use different versions of the same library. Create one with python -m venv .venv and activate it, or let uv manage it for you. Record your dependencies in pyproject.toml, with a or pinned versions.
Common trapinstalling packages globally: sooner or later two projects need different versions, or a system tool breaks, and "it works on my machine" follows. One environment per project, from day one.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking Python Fundamentals
Design Gurus · Beginner · $50
Python basics in a sensible order: collections, functions, classes and modules
- CourseFreeCS50's Introduction to Programming with Python
Harvard University · Beginner
Free Harvard course with real problem sets, and it teaches unit tests early
Practise
Keep handy
Also worth your time
The DNS, TCP, TLS and HTTP steps behind every request your backend will handle