Skip to content
Kuza Ndoto Academy

Installing Python & VS Code

Beginner → IntermediateChapter 1 · Page 2 of 565 min readUpdated 15 Nov 2026

Before you can write Python programs you need two things: the Python interpreter, which runs your code, and a code editor, where you write it. This page walks you through installing both on Windows, macOS and Linux, and checking that everything works.

Step 1: Check whether Python is already installed

Open a terminal. On Windows, search the Start menu for Terminal or Command Prompt. On macOS, open Terminal from Applications → Utilities. On Linux, press Ctrl+Alt+T on most distributions. Then type one of these commands and press Enter:

python --version
python3 --version
Python 3.13.1

If you see Python 3. followed by a number of 12 or higher, you are ready and can jump to Step 3. Your exact version number will probably differ from the one shown, and that's fine. If you see an error, a much older version or Python 2.7, install a fresh copy as described below.

Note

On Windows the command is usually python (or py). On macOS and Linux it is usually python3, because the plain python command may be missing or may point to something else. Throughout this series, if one command doesn't work, try the other.

Step 2: Install Python

Windows

  1. Go to python.org, open Downloads and choose the latest Python 3 release for Windows.
  2. Run the downloaded installer. On the first screen, tick the box Add python.exe to PATH. This lets you type python in any terminal window.
  3. Click Install Now and wait for it to finish.
  4. Close and reopen your terminal, then run python --version to confirm.

Newer releases on python.org may also offer the Python install manager, a small tool that installs and updates Python for you through the py command. Python is also available from the Microsoft Store. Any of these routes gives you a working Python; pick one and stick with it.

Common mistake

Forgetting to tick Add python.exe to PATH is the number one installation problem on Windows. The symptom is a message like 'python' is not recognized as an internal or external command. The quickest fix is to run the installer again, choose Modify or reinstall, and make sure the PATH option is selected. You can also try the py command, which is often available even when python isn't.

macOS

  1. Go to python.org, open Downloads and download the macOS installer (a .pkg file).
  2. Open it and follow the steps. When it finishes, a folder opens; double-click Install Certificates.command so Python can safely download things from the internet later.
  3. Open a new Terminal window and run python3 --version.

If you already use the Homebrew package manager, you can instead run:

brew install python

Linux

Most Linux distributions, such as Ubuntu, Debian and Fedora, come with Python 3 already installed because the system itself uses it. Check with python3 --version. To install or update it along with pip (the package installer) and venv (used later for virtual environments), use your package manager:

# Ubuntu / Debian
sudo apt update
sudo apt install python3 python3-pip python3-venv

# Fedora
sudo dnf install python3 python3-pip
Warning

On Linux, never try to remove or replace the system's own Python. Parts of the operating system depend on it. If you need a different version later, install it alongside the system one.

Step 3: Install VS Code and the Python extension

You could write Python in any plain text editor, but a proper code editor colours your code, spots mistakes as you type and runs programs with one click. This series uses Visual Studio Code (VS Code), which is free and works on all three systems.

  1. Download VS Code from code.visualstudio.com and install it. On Windows, ticking Add to PATH and Open with Code during setup is handy.
  2. Open VS Code and click the Extensions icon on the left side bar (or press Ctrl+Shift+X; Cmd+Shift+X on a Mac).
  3. Search for Python and install the extension published by Microsoft. It also brings in helpers for code completion and error checking.
  4. Open the Command Palette with Ctrl+Shift+P (Cmd+Shift+P on a Mac), type Python: Select Interpreter and pick the Python version you just installed.
Tip

VS Code has a built-in terminal. Open it from the menu with View → Terminal. Running commands there means you never have to leave the editor, and it opens in your project folder automatically.

Step 4: Test everything

In VS Code, choose File → Open Folder and create a new folder called kuza-python. Create a file named check.py and type:

import platform

print("Python is working!")
print("Version:", platform.python_version())
Python is working! Version: 3.13.1

Click the Run Python File button (the triangle in the top-right corner of the editor). The first line will match exactly; the second line shows your own version number, so it may differ. The import platform line borrows a built-in module that knows about your computer and your Python installation; you will learn about imports on the Importing Modules page.

Common mistake

Commands such as python --version belong in the terminal, not inside a Python program or the Python shell. If you see the >>> prompt, you are inside Python; type exit() to get back to the terminal first.

Key points

  • Check for Python with python --version (Windows) or python3 --version (macOS and Linux).
  • On Windows, tick Add python.exe to PATH when installing from python.org.
  • macOS users can use the python.org installer or Homebrew; Linux users use their package manager.
  • Install VS Code plus Microsoft's Python extension, then select your interpreter.
  • Test your setup by running a small .py file.
Up next · Getting StartedYour First ProgramWrite, save and run your first Python program.
→

Tip: use the ← and → keys to move between pages.