Installing Python

Topic 2 of 4 in Getting started6 min readBeginnerFree course

Overview

To write and run Python on your own computer you need two things: Python itself (the program that runs your code) and a code editor (where you write it). This lesson gets both set up. It takes about 15 minutes.

Step 1: Install Python

Windows

Python on Windows is now installed with the Python install manager:

  1. Open the Microsoft Store, search for Python install manager, and install it. (It’s also available from python.org/downloads.)
  2. Open a terminal (Windows Terminal or PowerShell) and run:
POWERSHELL
py install 3.15

The first time, the install manager runs a short configuration check and offers to fix common problems — accept its suggestions, including adding Python to your PATH.

  1. Close and reopen the terminal, then check:
POWERSHELL
python --version
# Python 3.15.2

The py command manages versions (py list shows what’s installed; py -3.14 runs a specific one), while python runs the default.

macOS

macOS doesn’t come with a current Python. Either:

Then, in Terminal:

Terminal
python3 --version
# Python 3.15.2

On macOS the command is usually python3 — python may not exist. Use python3 wherever this course says python.

Linux

Most distributions include Python 3, but often an older version. Check with python3 --version. For a current version, the easiest cross-distribution tool is uv:

Terminal
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.15

Or use your distribution’s packages (sudo apt install python3 python3-venv on Ubuntu/Debian, sudo dnf install python3 on Fedora). Any version from 3.10 up works for this course.

Which version?

Any 3.10 or newer works for this course; 3.15 is recommended. Python releases a new version every October and supports each for five years, so the latest version is a good default.

Step 2: Install a code editor

You can write Python in any text editor, but a code editor makes life much easier: colours, auto-completion, error underlines and a Run button.

We recommend Visual Studio Code (free, all platforms):

  1. Install it from code.visualstudio.com.
  2. Open the Extensions panel and install Python (by Microsoft).
  3. Create a folder for this course, for example python-course in your Documents, and open it with File → Open Folder.

Other good choices: PyCharm Community (a full Python IDE), Thonny (very simple, made for beginners), or any editor you already like.

Step 3: Run your first file

  1. In VS Code, create a file hello.py in your course folder:
Python
print("Hello from Python!")
  1. Click the ▶ Run button at the top right, or open the terminal (View → Terminal) and type:
Terminal
python hello.py
Text
Hello from Python!

If you see that line, everything works.

Troubleshooting

Problem Fix
python: command not found / 'python' is not recognized Python isn’t on your PATH. On Windows run py install --configure; on macOS/Linux try python3. Always reopen the terminal after installing.
Typing python opens the Microsoft Store Windows’ placeholder “app execution alias”. Install the install manager, or turn the alias off in Settings → Apps → Advanced app settings → App execution aliases.
The version is older than expected Several Pythons are installed. Check which one runs with python -c "import sys; print(sys.executable)", and choose the interpreter in VS Code with Python: Select Interpreter.
can't open file 'hello.py' The terminal is in a different folder. cd into your course folder first, or use VS Code’s Run button.

Online alternatives

If you can’t install software (a work laptop, a tablet), browser-based options let you follow most of this course: the editor at python.org/shell, Google Colab, GitHub Codespaces, or Replit. Later lessons on files and packages work best on your own machine.

Done? You have Python and an editor. Next: the two ways to run Python code — interactively and from files.

Exercise

Check your setup

Create a file called check_setup.py in a new python-course folder and run it from your terminal. It should print the Python version you’re running, where the Python program lives on your computer, and your operating system — and print a warning if the version is older than 3.10, the oldest version this course supports.

Python
# check_setup.py
import sys
import platform

# 1. Print the Python version (sys.version or platform.python_version())

# 2. Print where Python is installed (sys.executable)

# 3. Print the operating system (platform.system())

# 4. Warn if the version is older than 3.10 (sys.version_info)

Summary

  • Install Python 3.15: the Python install manager on Windows, the python.org installer or Homebrew on macOS, your package manager or uv on Linux.
  • Check the installation with python --version (or python3 --version on macOS/Linux).
  • A code editor such as VS Code with the Python extension gives colours, error hints and a Run button.
  • Keep your course work in one folder and open that folder in your editor.
  • If the command isn’t found, Python isn’t on your PATH — rerun the installer’s configuration or reopen the terminal.