Installing Python: macOS
This lesson is a tutorial on how to install Python on macOS.
macOS comes equipped with Python 2.7, but since we need the latest version of Python, we’ll need to go through 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.
1. 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 Python3, 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.
From the top menu, select the XCode drop-down menu and move to Preferences. Go to the Locations tab where we can see a Command Line Tools field:
Get hands-on with 1200+ tech skills courses.