Python comes preinstalled on Mac, but you probably need a newer version
Your Mac already has Python, but it's an old version that Apple includes for its own tools. If you're writing code or running programs that need Python, you need a current version instead. The fastest way is to download Python directly from python.org, which takes about five minutes and gives you a version you can update when new releases come out.
You have two main routes: install Python by itself (simplest for most people), or use a package manager like Homebrew (better if you plan to install many programming tools). This guide covers both, starting with the direct download because it's what most people need.
Key Takeaways
- Mac comes with Python 2, which is outdated; you need Python 3 from python.org or Homebrew.
- The direct download from python.org is the fastest route and works immediately without extra setup.
- After installation, open Terminal and type python3 --version to confirm it worked.
- If you install Homebrew first, you can install Python with one command and get automatic updates.
- The Mac version you have (Intel or Apple Silicon) matters; the installer detects this automatically.
Installing Python directly from python.org
Go to python.org in your web browser. Click the yellow "Download" button near the top of the page. The site detects your Mac automatically and offers the right version for your processor (Intel or Apple Silicon). Click the installer file when it finishes downloading.
The installer opens a window with a folder icon and an application icon. Drag the Python icon into the Applications folder. This copies Python to your Mac's Applications folder, where your system can find it. When the copy finishes, close the installer window.
Open Terminal (search for it in Spotlight by pressing Command + Space, type "Terminal", then press Enter). Type this command and press Enter:
python3 --version
Terminal shows the Python version number if the installation worked. If you see "command not found" instead, the installer didn't complete; try downloading and running it again.
Installing Python with Homebrew
Homebrew is a package manager — a tool that downloads and installs programming software for you. If you plan to install many tools over time, Homebrew saves steps. If this is your first time installing development software, skip this section and use the direct download instead.
First, install Homebrew. Open Terminal and paste this entire line, then press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Terminal asks for your Mac password. Type it (you won't see the characters appear) and press Enter. Homebrew downloads and installs. This takes a few minutes. When it finishes, Terminal shows a message ending with "Installation successful!"
Now install Python by typing this command and pressing Enter:
brew install python
Homebrew downloads Python and installs it automatically. When it finishes, check the installation by typing:
python3 --version
Terminal shows the version number if it worked.
Verify Python is working by running a test program
Knowing the version number confirms Python installed, but running actual code confirms it works. In Terminal, type this command and press Enter:
python3
Terminal changes to show >>> instead of your normal prompt. This is Python's interactive mode — you can type Python code and see results immediately. Type this line and press Enter:
print("Python is working")
Python prints the text on the next line. Type exit() and press Enter to leave Python and return to Terminal's normal prompt.
If Python printed your text, the installation is complete and working. If you see an error instead, the installation didn't finish correctly; try the direct download from python.org again.
Understanding which Python version you have
Your Mac comes with Python 2, which stopped receiving updates in 2020. When you type python in Terminal, it runs the old version. When you type python3, it runs the new version you just installed. Always use python3 when running programs or following tutorials written for current Python.
Some older programs still need Python 2, but new code almost always uses Python 3. If a tutorial or program tells you to type python, check whether it was written recently. If it was written in the last few years, the author probably meant python3 and just didn't specify.
Updating Python when new versions release
If you installed Python directly from python.org, check python.org every few months for new releases. Download and run the new installer the same way you did the first time. The new version replaces the old one.
If you installed Python with Homebrew, updating is simpler. Open Terminal and type:
brew upgrade python
Homebrew checks for newer versions and installs them automatically. This is one reason some people prefer Homebrew — you don't have to remember to check for updates yourself.
Troubleshooting common installation problems
If Terminal says "command not found" when you type python3, the installer didn't complete. Download python.org's installer again and run it. Make sure you drag the Python icon all the way into the Applications folder and wait for the copy to finish.
If you installed Homebrew but python3 still doesn't work, Homebrew may not have finished installing. Close Terminal completely and open it again. Type python3 --version once more. If it still doesn't work, type brew doctor in Terminal. Homebrew tells you what's wrong and how to fix it.
If you see "Permission denied" when trying to install Homebrew, you may have typed the command wrong. Copy it directly from this page instead of typing it by hand. Paste it into Terminal with Command + V and press Enter.
Frequently Asked Questions
Do I need to uninstall the Python that came with my Mac?
No. Apple's Python is separate from the version you install. Removing it can break Mac's own tools. Leave it alone and just use python3 when you need the new version.
What's the difference between Python 2 and Python 3?
Python 2 stopped being updated in 2020. Python 3 is the current version with new features and security fixes. Almost all new code uses Python 3. If a tutorial doesn't specify which version, it means Python 3.
Can I have both Homebrew and the direct python.org installation at the same time?
Yes, but it can cause confusion. If you install both, Terminal uses whichever one appears first in your system's search path. For simplicity, pick one method and stick with it. The direct download is fine for most people.
How do I know if my Mac has an Intel or Apple Silicon processor?
Click the Apple menu in the top-left corner and select "About This Mac." Look for "Chip" or "Processor." If it says "Apple" followed by a number (like "Apple M1"), you have Apple Silicon. If it says "Intel," you have an Intel processor. Python's installer detects this automatically, so you don't need to choose.
What do I do if I want to remove Python later?
If you used the direct installer, open Applications, find Python, and drag it to Trash. If you used Homebrew, open Terminal and type brew uninstall python. Either way, your old Mac Python stays untouched.