Install Python with uv

Your terminal is ready. Now you install the Python interpreter so you can run .py files on your own computer. You will install one small tool called uv, and uv installs Python for you.

What uv is

uv is a program that installs Python versions and manages Python projects. For this course you only use the install side. One command installs Python; after that you type python to run programs the same way the lessons do.

Teams use uv for larger reasons: pinning the exact Python version a project needs, keeping each project's packages separate. Those matter when you have real projects. For now, think of uv as the quickest way to get Python onto your computer.

Install uv

Pick the row for your system and run the command in your terminal:

System Command
Mac brew install uv (install Homebrew first if you do not have it)
Windows winget install --id=astral-sh.uv -e (run in Git Bash or PowerShell)
Linux curl -LsSf https://astral.sh/uv/install.sh | sh

Check that it installed:

uv --version

You should see a line that starts with uv and a version number. If the command is not found, close and reopen your terminal, then try again. If it still fails, re-run the install command for your system.

Install Python

Use uv to install the version of Python this course uses:

uv python install 3.12

The first run downloads Python, so it takes a minute. After that, check it:

python --version

You should see Python 3.12 and some digits. If python is not found, close your terminal and open a new one, then try again.

Recall

What does uv python install 3.12 do?

Show the answer

It downloads and installs Python 3.12 so you can run .py files on your computer with the python command.

Try it

Run Python itself with no file. It opens an interactive prompt where you can type one line of Python at a time:

python

You will see >>>. Type a line and press Enter:

>>> print("Hello")
Hello

To leave, type exit() and press Enter. You are back at your usual prompt.

Next: Set up your editor.