macOS comes equipped with Python 2.7, but since we need the latest version of Python, we’ll need to follow a few installation steps. Below, we’ve listed the different ways to set up Python3 on macOS. You may skip this tutorial if it is not relevant to you.

Using the terminal

This is for users who are well-versed with the macOS terminal. Through the terminal, we can safely install the latest version of Python 3, but first, we need to get some required packages.

Installing Xcode

Xcode is macOS’s official integrated development environment. We’ll need this for Python. Some machines may already have XCode. For those who don’t, visit the Xcode app store page and download it from there.

We can also install it directly from the terminal using xcode-select --install.

Accessing Apple command line tools

Open XCode and complete the installation. It may require authentication through our password. Select the XCode drop-down menu from the top menu and move to "Preferences." Go to the "Locations" tab, where we can see a "Command Line Tools" field:

Get hands-on with 1400+ tech skills courses.