The Mac System Python
Python is not pre-installed on Mac. Xcode Command Line Tools installs a system Python. How to check the default Apple macOS system Python.
Python may already be installed on your Mac. This guide shows how to check if a system Python is installed. But consider the system Python is there for Apple utilities, not for you, so you should install Python separately if you want to run Python programs or develop in Python.
Before you get started
You'll need a terminal application to check for Python. Apple includes the Mac terminal but I prefer Warp Terminal. Warp increases developer productivity, helping you remember easily-forgotten commands and adds AI troubleshooting. Download Warp Terminal now; it's FREE and worth a try.
Python latest version
The current Python version is 3.13, as of October 2024. New releases of Python come yearly, typically released in October. The next version, Python 3.14, is expected in October 2025.
A system Python on macOS
Python is not pre-installed on macOS, though developers often find it on Macs. Here's why.
Pre-installed on older Macs
You might have an older Mac. Prior to macOS 12.3, Macs came with Python 2.7 pre-installed. Don't use any Python 2 version for development.
What is your macOS version? MacOS Sonoma (version 14) is the newest as of September 2023. If you have an older macOS version, check macOS and update macOS before you install Python.
Installed with Xcode Command Line Tools
You might have Python because developers commonly install Xcode Command Line Tools. It's necessary for almost any software development project. When you install Xcode Command Line Tools, Apple includes Python 3.9.6. That's an older version.
Some Apple development utilities depend on the system Python: Core Symbolication, LLDB, Bitcode build tool, and others. You should not attempt to update or remove the system Python installed with Xcode Command Line Tools. Install a newer Python to run Python programs or develop software. See the guide:
Check if a system Python is installed
You can check to see if your Mac already has Python.
$ python --version
zsh: command not found: python
You'll see zsh: command not found: python
if Python is not available.
Try python3 --version
and which -a python3
to check if Python was installed with Xcode Command Line Tools.
$ python3 --version
Python 3.9.6
$ which -a python3
/usr/bin/python3
If you have Python 3.9.6 installed at /usr/bin/python3
, you likely have the system Python installed by Xcode Command Line Tools. You can confirm this with xcode-select -p
which will show if Xcode Command Line Tools is installed.
$ xcode-select -p
/Library/Developer/CommandLineTools
What happens if you use a system Python
Some developers use the system Python 3.9.6 for simple scripts or command-line utilities. To avoid the error zsh: command not found: python
some developers set an alias python3 to python to use the system Python.
You may read elsewhere that using the system Python to run user-installed Python programs or develop software will lead to dependency conflicts or pollute and break the system Python. In fact, recent versions of the Pip package manager make it difficult to install packages into the system Python. If you install packages with the system Python (using pip3 install
or python3 -m pip install
), you'll see a message Defaulting to user installation because normal site-packages is not writeable
and a copy of Python 3.9 will be created in /Users/username/Library/Python/3.9/
. Any packages you install will be saved in a "user Python" folder /Users/username/Library/Python/3.9/lib/python/site-packages
. However, you need to set the Mac PATH for Python to use these packages.
In general, using the system Python for installing and running programs or developing software quickly gets complicated, requiring expertise. And experts prefer to install Pipx to run programs or install Python separately and set up a proper development environment for programming.
In short, don't use the system Python even if it is installed. It's for the system, not you.
Install Python
See the guide Install Python for a discussion of options. Here's my recommendations:
-
Install Python with Pipx for scripts and utilities.
-
Install Python with Rye for programming.
What's next
My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.