Skip to content

Installation

You can find all download links in this official downloads page.

TIP

The following instructions will mostly provide access to python3 command on the terminal (macOS/linux) or Powershell (windows). If you want to access Python via python command, you can either create a symlink or create an alias. For Windows Powershell, the alias can be created using Set-Alias python python3.

MacOS

While older versions of macOS came with Python 2.7 pre-installed, newer versions (starting with Catalina) no longer include Python by default. However, there are several ways to install Python on macOS, as outlined below.

Using Official Python Installer

Users who favor the stability and reliability of the official distribution from the Python Software Foundation will find this method ideal. To install Python using the official installer:

  • Visit the official downloads page.
  • Download the installer package for your desired Python version.
  • Run the installer and follow the on-screen instructions.

Once installed, the Python binary is typically accessible at /usr/local/bin/python3, which is a symlink pointing to the real Python binary. This installation method also includes IDLE, the integrated development environment that allows you to interact with the Python interpreter.

Using Homebrew

You can also install Python using Homebrew, which is a popular package manager for macOS that simplifies the installation of open-source software. This is one of the recommended ways of installing Python, especially for developers.

After Homebrew is set up on macOS, you can install Python using:

shell
brew install python

After installation, you may have to adjust the PATH environment variable to access Homebrew's Python.

Using Xcode Command Line Tools

When you install the Xcode Command Line Tools, macOS provides a system version of Python. This version is primarily meant to support system tasks and the development environment. However, because it’s usually outdated and not updated often, it’s not ideal for everyday programming.

Xcode command line tools can be installed using the following command in the terminal:

shell
xcode-select --install

NOTE

On macOS, a stub is a lightweight executable that doesn't contain the full implementation of a program itself but instead serves as a pointer or intermediary that delegates execution to another binary.

The Python binary installed through Xcode Command Line Tools, can be referenced via /usr/bin/python3. However, this isn't a real standalone Python binary, but a "stub" that delegates the execution to the actual Python binary installed within the Xcode Command Line Tools directory. You can find the true binary path by using the following command:

shell
xcrun --find python3

Using Conda Distributions (Anaconda/Miniconda)

Conda is both a package manager and an environment management system. The distributions provided by Anaconda or Miniconda are popular in the data science community. To install Python using the Conda distribution, follow these steps:

  • Visit the Anaconda downloads page, which also includes Miniconda installers.
  • Download the installer package that matches your operating system.
  • Run the installer and follow the on-screen instructions.

This approach is particularly favoured by data scientists and researchers due to its suitability for data-intensive workflows.

Linux

Using System Package Manager

Most Linux distributions come with Python 3 pre-installed. However, if you need to install or upgrade Python manually, you can use your distribution's package manager. Here are the commands for a few common distributions:

Debian/Ubuntu

shell
sudo apt update
sudo apt install python3

Fedora

shell
sudo dnf install python3

Arch Linux

shell
sudo pacman -S python

Note that the version of Python available through the system package manager may not be the latest release.

Using Official Python Installer

Refer this section above

Using Conda Distributions (Anaconda/Miniconda)

Refer this section above

Windows

Using Official Python Installer

Refer this section above

Using Conda Distributions (Anaconda/Miniconda)

Refer this section above

Using Windows Store

Windows 10 and later include a Python distribution via the Microsoft Store.

  • Open the Microsoft Store.
  • Search for “Python” and select your desired Python version from Python Software Foundation.
  • Click "Get" to install Python.

The Windows Store version might have minor differences and restrictions compared to the official installer.

Using Chocolatey

Chocolatey is an alternative package manager for Windows. You can install Python using following command:

shell
choco install python

Note that this may offer slightly different versions than the official installer.