Skip to content

Install Python

Goal: get Python running on your computer and confirm it works.

Step 1: Download and install

  1. Go to python.org/downloads and click the big yellow Download Python button.
  2. Run the installer.
  3. Important: on the first screen, tick the box "Add python.exe to PATH" before clicking Install Now.

Screenshot placeholder: Windows installer with the Add to PATH checkbox

  1. Go to python.org/downloads and download the macOS installer.
  2. Open the .pkg file and follow the steps.

macOS ships with an old Python. Always use the one you just installed by typing python3, not python.

Most distributions already include Python 3. To check, open a terminal and run:

python3 --version

If it is missing, install it with your package manager, for example on Ubuntu or Debian:

sudo apt install python3

Step 2: Open a terminal

The terminal is a window where you type commands. You will use it to run your programs.

  • Windows: press the Windows key, type PowerShell, and press Enter.
  • macOS: press Cmd+Space, type Terminal, and press Enter.
  • Linux: usually Ctrl+Alt+T.

Step 3: Check that Python works

Type this and press Enter:

python --version

On macOS or Linux use python3 --version instead. You should see something like:

Python 3.12.4

Any version starting with 3.10 or higher is fine for this course.

Getting 'python is not recognized' on Windows?

The Add to PATH box was probably not ticked. Run the installer again, choose Modify, and make sure the option is enabled. Then close and reopen PowerShell.

Step 4: Install a code editor

Download and install Visual Studio Code. When it opens for the first time, install the Python extension by Microsoft from the Extensions panel on the left.

That is all the setup you need. Write your first program