Set Up Your Environment (Optional)
This lesson is optional. If you already write Python and have an editor you like, you can skip it — you are set. It is here for anyone newer to the toolchain who wants a clean, consistent setup before the first module.
One thing worth a glance even if you skip the rest: this path pins Python 3.12 and uses uv to manage environments and dependencies. When a later lesson says “lock your dependencies” or “run it as a module,” it assumes uv and Python 3.12 are in place. If you already have those, you are ready. If not, the rest of this lesson installs Python 3.12, uv, and VS Code from scratch.
What you are installing
Three tools, each doing one job:
- Python 3.12 — the language runtime everything runs on. This path pins to 3.12 so that the code you write behaves the same as the code in the lessons.
- uv — a fast tool that manages your Python versions, your project environments, and your dependencies. It replaces the older pile of
pip,venv, andpyenvwith one command, and it produces a lock file so a project reproduces the same environment on any machine. - VS Code — the editor. Any editor works, but VS Code is the one the lessons reference, with good Python support out of the box.
You install each once. After that, every project reuses them.
Python 3.12
uv can install and manage Python for you, so the simplest path is to install uv first (next section) and let it handle Python. If you would rather install Python directly, download the 3.12 release from python.org/downloads and run the installer for your system.
To check what you have, open a terminal and run:
python3 --version
If it prints Python 3.12.x, you are set. If it prints an older version or nothing, do not worry — uv will install 3.12 for you in the next step, and you do not need to remove anything that is already there.
uv for environments and dependencies
uv is the one tool you will run most. Install it with the official installer.
On macOS or Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
On Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Close and reopen your terminal so the new command is found, then confirm it installed:
uv --version
Now have uv install Python 3.12, so your projects always run on the version the lessons use:
uv python install 3.12
From here, uv is how you create a project environment and add dependencies. You do not activate environments by hand or install packages globally — uv keeps each project’s dependencies isolated and recorded in a lock file. The project lessons walk through uv commands as you need them; this step only makes sure the tool is on your machine.
VS Code
Download VS Code from code.visualstudio.com and install it for your system.
Once it is open, install the Python extension from the Extensions panel (the square icon in the left bar, or Cmd/Ctrl+Shift+X). Search for “Python”, published by Microsoft, and install it. That gives you syntax highlighting, error checking, and the ability to run code from inside the editor.
You can also enable the terminal inside VS Code (Ctrl+ backtick) so your editor and your commands live in one window. Everything you run in this path works from that terminal exactly as it does from a standalone one.
Check it all works
Run these three commands. If each prints a version, your environment is ready:
uv --version
uv python list
code --version
The first confirms uv is installed, the second shows the Python versions uv manages (you should see 3.12 in the list), and the third confirms VS Code’s command-line launcher is available. If code is not found, open VS Code and run Shell Command: Install ‘code’ command in PATH from the command palette (Cmd/Ctrl+Shift+P).
To finish, create one real environment so you end this lesson with a working setup, not just installed tools. A virtual environment is a private, per-project copy of Python — the first module explains what it is and why each project gets its own; here you are only confirming uv can make one on 3.12. In an empty folder, run:
uv venv --python 3.12
uv creates a .venv/ directory using Python 3.12. Confirm it is the version the lessons expect:
.venv/bin/python --version
If that prints Python 3.12.x — even when the python3 on your system is a different version — the toolchain is working: uv gave this project its own 3.12, isolated from whatever else is on your machine. That is the setup every module project builds on.
With Python 3.12, uv, and VS Code in place, you have the toolchain every module is built on. The next lesson sets up your portfolio site — the first repository you will fork, clone, and publish, using the git workflow you just learned.