Skip to content
Python

How to Install Python on Windows, macOS and Linux

Ihsan Ullah · Updated · 9 min read
Python course lesson 2 cover: how to install Python on Windows, macOS and Linux step by step

Python course · Module 1: Getting started · Lesson 2 of 63

Quick answer: To install Python, get the latest stable version from python.org/downloads (Python 3.15.2 in November 2026). On Windows, use the Python install manager from python.org or the Microsoft Store. On macOS, run the .pkg installer from python.org. On Linux, Python 3 is usually already there; check with python3 --version. Then open a new terminal and check the version to confirm it works.

In this lesson you will learn:

  • which Python version to pick
  • how to check if Python is already installed
  • how to install Python on Windows, macOS and Linux, step by step
  • what “Add to PATH” means and why it matters
  • how to check that pip, Python’s package installer, works

Before you start: read Lesson 1, What Is Python Used For?, so you know what Python is and what the interpreter does.

Which Python version should you install?

A new main version (3.14, 3.15 and so on) comes out each October, followed by small fix releases (3.15.1, 3.15.2). The python.org downloads page showed these versions on 4 November 2026:

VersionStatusFirst releasedSupported until
3.16pre-release (testing only)planned 2027-10-062032-10
3.15bugfix (newest stable)2026-10-092031-10
3.14bugfix2025-10-072030-10
3.13security fixes only2024-10-072029-10
3.12security fixes only2023-10-022028-10
3.11security fixes only2022-10-242027-10
3.10end of life2021-10-042026-10

Simple rule: install the newest stable version, 3.15.2 at the time of writing. Skip “pre-release”, “alpha”, “beta” and “release candidate” versions; those are for testing. The examples in this course were tested on Python 3.14.6 (the 3.14 series still gets bugfix releases; its newest is 3.14.10), and they work the same on newer 3.x versions such as 3.15.

Check if Python is already installed

Open a terminal (Windows: search for “Terminal” in the Start menu; macOS: Applications, then Utilities, then Terminal). Then type the version command for your system:

  • Windows: python --version or py --version
  • macOS and Linux: python3 --version

Here is a real run on our Linux test machine (Ubuntu 24.04):

$ python3 --version
Python 3.13.18

$ python3.14 --version
Python 3.14.6

The answer is one line: Python and a version number. Notice that one computer can have several Pythons side by side: here python3 starts Python 3.13 (installed separately on this machine; Ubuntu 24.04’s own python3 is 3.12, see the Linux section) and python3.14 starts Python 3.14. The command you type decides which one runs.

If you get “command not found” or “not recognized”, Python is not installed, or your terminal cannot find it. Install it with the steps below.

How to install Python on Windows

The official Using Python on Windows guide recommends the Python install manager. It installs Python, adds the python and py commands, and can update Python later. Python 3.15 supports Windows 10 and newer.

  1. Get the install manager in one of two ways: from the Microsoft Store (click “Install”), or from python.org/downloads (download the install manager, double-click it, choose “Install”). The docs say the two versions are identical.
  2. Open a new terminal window. Old windows do not see new commands.
  3. Type python. If no Python is installed yet, the docs say this command installs the newest stable version and starts it.
  4. If asked whether to add a folder to your PATH, say yes. This adds extra commands such as python3.15.
  5. Check with python --version. py list shows all installed versions; py install 3.15 adds a specific one.

Option 2: the classic installer (.exe)

Older tutorials use the .exe installer. The docs mark it deprecated since 3.14; it “will not be produced for Python 3.16 or later”. If you use it, tick the option to add Python to PATH on the first screen before you click “Install Now”.

PATH is the list of folders where your terminal looks for commands. If the Python folder is not on it, python gives an error even though Python is installed.

If python opens the Microsoft Store or is “not recognized”

The Windows docs give these checks, in order:

  • Make sure the Python install manager is installed (see Option 1).
  • Click Start, open “Manage app execution aliases”, and check that the “Python (default)” aliases are turned on. If they are on, turn them off and on again.
  • Check whether the py command works. If py works but python does not, the problem is the alias or PATH, not Python itself.

We could not run Windows on our test machine, so this section shows no Windows output. Follow the official guide if your screen looks different.

How to install Python on macOS

Recent macOS versions have a python3 command in /usr/bin/python3. The official Using Python on macOS guide says this is “a usually older and incomplete version” for Apple’s developer tools, and that you “should never modify or attempt to delete” it. Install your own Python next to it.

  1. Download the macOS installer from python.org/downloads. It runs on Apple Silicon and Intel Macs.
  2. Double-click the .pkg file and click through: Read Me, License (“Agree”), then “Install”. You need an administrator account. Since Python 3.15, the installer also adds an extra, advanced “free-threaded” build of Python by default; beginners can leave this option as it is.
  3. Open the new Python 3.15 folder in Applications and double-click Install Certificates.command. The guide says the install is complete when you see Successfully installed certifi and update complete.
  4. Open a new Terminal window and type python3 --version.

On macOS, type python3, not python. The guide says the default options make your new python3 run instead of the system one. If you already use Homebrew, you can install Python with it instead; the VS Code Python tutorial uses brew install python3.

How to install Python on Linux

The Using Python on Unix platforms guide says “Python comes preinstalled on most Linux distributions, and is available as a package on all others”. So first run python3 --version.

If Python 3 is missing, install it with your system’s package manager:

  • Ubuntu and Debian: sudo apt update then sudo apt install python3
  • Fedora: sudo dnf install python3

Linux packages are often older than python.org. On our Ubuntu 24.04 machine, the package manager offers Python 3.12:

$ apt-cache policy python3
python3:
  Installed: 3.12.3-0ubuntu2.1
  Candidate: 3.12.3-0ubuntu2.1
  Version table:
 *** 3.12.3-0ubuntu2.1 100
        100 /var/lib/dpkg/status

“Candidate” is the version it would install. Python 3.12 still gets security fixes, so it is fine for learning; for the newest version, use uv (next section). Never remove the system Python on Linux; parts of the system use it.

Another option: install Python with uv

uv is a popular free tool for managing Python versions and packages. Once uv is installed (installation page), one command installs Python on Windows, macOS or Linux:

$ uv python install 3.14
Python 3.14 is already installed

$ python3.14 --version
Python 3.14.6

On our machine 3.14 was already there. Use uv python install with no number for the newest version. The uv docs say it adds a versioned command such as python3.15; the experimental --default option also adds python and python3. uv is optional for this course.

Check that pip works

pip installs extra packages such as pandas. Check it with -m pip, which uses the pip of that exact Python:

$ python3.14 -m pip --version
pip 26.1.2 from /root/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/lib/python3.14/site-packages/pip (python 3.14)

The path in the middle shows where this Python is installed on our test machine; yours will be different. The end of the line, (python 3.14), tells you which Python this pip belongs to. On Windows, use py -m pip --version; on macOS and Linux, python3 -m pip --version.

Try it yourself

Exercise 1: Ask Python for its version

Save this as check_version.py and run it with your Python (you will learn more about running scripts in Lesson 3). It prints the version and the exact Python program that ran it.

import platform
import sys

print("Python version:", platform.python_version())
print("Python program:", sys.executable)

Exercise 2: Check pip

Run the pip check for your system and find the Python version at the end of the line.

Exercise 3: Say hello from the prompt

Type python3 (macOS, Linux) or python (Windows) with nothing after it. At the >>> prompt, print the text Python is installed!, then leave with exit().

Solutions

Solution 1

$ python3.14 check_version.py
Python version: 3.14.6
Python program: /root/.local/bin/python3.14

The second line shows which Python file ran the script. On your computer the version and the path will be your own.

Solution 2

$ python3.14 -m pip --version
pip 26.1.2 from /root/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/lib/python3.14/site-packages/pip (python 3.14)

If you see a message ending in No module named pip, this Python has no pip yet; on Ubuntu, install the python3-pip package.

Solution 3

Python 3.14.6 (main, Jul 18 2026, 17:01:31) [Clang 22.1.3 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Python is installed!")
Python is installed!
>>> exit()

After the welcome message, >>> means Python is waiting for your code.

Common mistakes

  • Typing terminal commands inside Python. At the >>> prompt, python --version gives NameError: name 'python' is not defined. Leave Python with exit() first, then type the command in the terminal.
  • Using the old terminal window. A terminal opened before the install does not see the new commands. Close it and open a new one.
  • Forgetting PATH with the classic Windows installer. Python is installed but python is “not recognized”. Use the install manager, or run the classic installer again and add Python to PATH.
  • Installing a pre-release. Versions marked alpha, beta or “pre-release” (such as 3.16 in November 2026) are for testing, not learning.

Frequently asked questions

Which Python version should a beginner install?

Install the newest stable version from python.org, which is Python 3.15.2 in November 2026. Any version that still gets bugfixes, such as 3.14, also works for this course.

Can I have two Python versions on one computer?

Yes. Each version has its own command, such as python3.14 and python3.15, and on Windows py list shows all of them. Use python -c "import sys; print(sys.executable)" to see which one a command starts.

Do I need to uninstall the old Python first?

No. Different versions can live side by side. On macOS and Linux, never delete the system Python, because other programs use it.

Summary

  • Install the newest stable Python from python.org (3.15.2 at the time of writing); avoid pre-releases.
  • Windows: use the Python install manager; the classic .exe installer is deprecated.
  • macOS: run the .pkg installer, then Install Certificates.command, and use python3.
  • Linux: Python 3 is usually preinstalled; use your package manager or uv for others.
  • Check with --version in a new terminal, and check pip with -m pip --version.

Next lesson

Next: Lesson 3, How to Run a Python Script: the REPL, .py Files and VS Code.

Sources

Ihsan Ullah

Written & tested by Ihsan Ullah

Data analyst with 3 years of experience and a Bachelor's degree in Computer Science. I write clear, practical guides on data, SQL, Python and AI.

More about me →

Leave a comment

Your email address will not be published. Required fields are marked *