Author's Picture
Author: Joel Gray Published: 22 January 2024 Read Time: ~3 minutes

How to install Python on Linux, Windows and MacOS

Are you looking to dive into the world of Python programming but unsure how to get started with installing Python on your computer? Whether you’re a budding developer or just exploring coding, our comprehensive guide on “How to Install Python” is your go-to resource.

Python’s popularity stems from its simplicity and versatility, making it a favoured choice for professionals and hobbyists alike.

In this detailed tutorial, we cover the essentials of Python installation across various operating systems, including Debian, Ubuntu, Arch Linux, macOS, and Windows. Each operating system has its unique approach, and we’ve got them all covered for you. From updating package lists in Linux distributions to running installers on Windows, our guide is tailored to make your Python setup experience seamless and straightforward.

Linux

Debian/Ubuntu:

  1. sudo apt-get install python3

Arch:

  1. sudo pacman -S python

Windows

  1. Download installer from python.org
  2. Run installer
  3. Select “Add Python to PATH”
  4. Click “Install”

MacOS

  1. brew install python

Detailed Instructions:

Debian/Ubuntu

Open a Terminal

  1. Use a keyboard shortcut, typically Ctrl + Alt + T.
  2. Alternatively, you can search for “Terminal” in your system’s application menu and open it from there.

Install Python

Run the following commands, which will install Python using the apt package manager.

Note: You should update your page list first and upgrade any available pages.

sudo apt-get update && sudo apt upgrade
sudo apt-get install python3

Check if Python is Installed

You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.

python3 --version

Arch Linux

Open a Terminal

  1. Use a keyboard shortcut, typically Ctrl + Alt + T.
  2. Alternatively, you can search for “Terminal” in your system’s application menu and open it from there.

Install Python

Run the following commands, which will install Python using the pacman package manager.

Note: You should update your page list first and upgrade any available pages.

sudo pacman -Sy
sudo pacman -S python

Check if Python is Installed

You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.

python3 --version

Windows

Download Python Installer

  1. Go to Python.org
  2. Click on the link for you system – most modern PCs will be "Windows Installer (64-bit)"
  3. Download the version installer that you desire, I use Python3.11 currently.

Install Python

  1. Locate your downloaded installer which probably in your Downloads folder. Depending on what version you install the file will be called something like: python-3.11.7-amd64.exe
  2. Run the installer by double clicking on it (It shouldn’t require Administration permissions.).
  3. When the installer runs use the express/default install.
  4. Select “Add Python to PATH” before installation.
  5. Click “Install Now”

Check if Python is Installed

You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.

python --version

MacOS

Open a Terminal

  1. Open Finder.
  2. Choose Go from the menu bar ➙ Utilities.
  3. Scroll down to find Terminal and double-click it to open.

Install Homebrew

If Homebrew is not installed, you should install it first as we need it to install Python. Run the following command to install it.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Python using Homebrew

Type the following command into a terminal and press enter to run it.

brew install python

Check if Python is Installed

You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.

python3 --version

Installing PIP

Regardless of what system you’re on you’ll need to install PIP to install Python dependencies and packages. Check out our Blog on how to install Python PIP on each system.