Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Python on macOS

Download the official Python installer for macOS and check the install.

How-To Guides2 min read9 steps8 screenshots

Why install Python yourself

  1. Older macOS versions have an old Python. Recent versions of macOS do not include a usable Python 3 by default, and the system copy should not be changed.
  2. Many tools, libraries and frameworks need a recent Python.
  3. Python is a great language to learn programming.

Step 1: Check what you have

Open Terminal and run:

python3 --version
Checking the Python version

If macOS asks you to install the command line developer tools, you can accept. That gives you an older Python 3.

Step 2: Download the latest Python

Go to the Python website (python.org/downloads) and download the latest macOS installer (a .pkg file).

The Python download page
The Python pkg file

Step 3: Install Python

  1. Double-click the python-3.x.x-macos11.pkg file to start the installer.
  2. On the welcome screen, click Continue.
    The Python installer
  3. Read the license, click Continue, then Agree.
    The license agreement
  4. Choose the install location (the default is fine).
    The installation type
  5. Enter your macOS administrator password if you are asked.
  6. The install takes a few minutes. When it ends, click Close. A Finder window with extra files, such as Install Certificates.command, may open. Run Install Certificates.command once.

Step 4: Check the install

Open a new Terminal window:

python3 --version
The new Python version

Start the interpreter:

python3

Try a line of code:

print("Hello, Python!")
Python syntax in the interpreter

Leave the interpreter with exit().

Install packages

Use pip:

pip3 install requests

For clean projects, use a virtual environment:

python3 -m venv venv
source venv/bin/activate

Another way: Homebrew

If you use Homebrew:

brew install python

Quick recap

  • Download the .pkg from python.org and run it.
  • Check with python3 --version.
  • Use pip3 and virtual environments.