How to Install Python on Your System: A Guide

Here’s a detailed overview of your options for installing Python. If you’re looking for help deciding, then go for the official installers if using Windows or macOS.

This text is part of a Real Python tutorial by Leodanis Pozo Ramos.


Installing Python on your system involves a few straightforward steps. First, check if Python is already installed by opening a command-line interface and typing python --version or python3 --version. You can install Python on Windows using the official installer from python.org or through the Microsoft Store. On macOS, you can use the official installer or Homebrew. For Linux, use your package manager or build Python from source.

This lesson covers installing the latest Python on the most common operating systems: Windows, macOS, and Linux. It doesn’t cover all the existing Linux distributions but focuses on the most popular Linux distributions available today.

Windows: How to Check or Get Python

In this section, you’ll learn to check whether Python is installed on your Windows operating system (OS) and which version you have. You’ll also explore three installation options that you can use on Windows.

Checking the Python Version on Windows

To check whether you already have Python on your Windows machine, open a command-line application like PowerShell or the Windows Terminal.

Follow the steps below to open PowerShell on Windows:

  1. Press the Win key.
  2. Type PowerShell.
  3. Press Enter.

Alternatively, you can right-click the Start button and select Windows PowerShell or Windows PowerShell (Admin). In some versions of Windows, you’ll find Terminal or Terminal (admin).

With the command line open, type in the following command and press the Enter key:

Language: Windows PowerShell
PS> python --version
Python 3.x.z

Using the --version switch will show you the installed version. Note that the 3.x.z part is a placeholder here. In your machine, x and z will be numbers corresponding to the specific version you have installed.

Alternatively, you can use the -V switch:

Language: Windows PowerShell
PS> python -V
Python 3.x.z

Using the python -V or python—-version command, you can check whether Python is installed on your system and learn what version you have. If Python isn’t installed on your OS, you’ll get an error message.

Knowing the Python Installation Options on Windows

You’ll have different options to install Python if you’re on a Windows machine. Here are three popular ones:

  1. The official Python installer for Windows: This approach involves downloading the Python installer directly from the python.org website. It’s recommended for intermediate and advanced developers who need more control during the setup process.
  2. The Microsoft Store: The quickest installation option on Windows involves using the Microsoft Store app. This is recommended for beginner Python programmers looking for an easy-to-set-up interactive experience.
  3. The Windows subsystem for Linux (WSL): The WSL allows you to run a Linux environment directly on Windows.

In this section, you’ll focus on only the first two options, which are the most popular ones on Windows environments.

If you want to install Python in the WSL, you can read the Linux-related sections of this tutorial after installing the Linux distribution of your choice.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

You must own this product to join the conversation.