Next-Gen App & Browser Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

How to Install Python on Mac

Updated November 30, 2026 · Written and reviewed under our editorial policy

To install Python on a Mac, download the latest macOS installer from python.org, open the .pkg file and follow the steps. Then double-click "Install Certificates.command" in the new Python folder in Applications, open Terminal and run python3 --version. Developers who already use Homebrew can run brew install python instead.

  • Go to python.org/downloads and download the macOS installer.
  • Open the .pkg file and complete the installer (admin password needed).
  • Open Applications > Python 3.x and double-click Install Certificates.command.
  • Open Terminal and run python3 --version.

Source: Python documentation, "Using Python on macOS" (docs.python.org), checked 2026-11-28.

Is Python already installed on your Mac?

To see whether Python is already installed on your Mac, open Terminal (Applications > Utilities > Terminal) and run:

python3 --version
which python3

A "Python 3.x.y" line means a Python 3 is installed, and which python3 shows where it lives. On a Mac without developer tools, python3 opens a dialog offering to install Apple's command line developer tools instead. Those tools include a python3 at /usr/bin/python3 that's fine for running a quick script, but macOS manages it: don't modify it, and install your own Python for development work. For every way to check your Python version, see our full guide.

Install Python from python.org

The python.org installer is the official way to install Python on a Mac. It's a universal2 .pkg file, so the same download runs natively on Apple silicon and Intel Macs. As of November 30, 2026, the latest release on python.org is Python 3.15.2.

  • Go to python.org/downloads and click the download button for the latest Python 3 release for macOS.
  • Open the downloaded .pkg file and click through the installer, entering your admin password when asked.
  • Open the new Python 3.x folder in Applications and double-click Install Certificates.command. A Terminal window opens and installs the root certificates Python uses for HTTPS.
  • Open a new Terminal window and run python3 --version.

The installer puts a Python 3.x folder in Applications (with IDLE, a basic editor, and Python Launcher), the Python framework in /Library/Frameworks, and links for python3 and its related commands in /usr/local/bin. IDLE is enough to get started; for a full editor, compare the best Python IDEs.

Python installed? Set up Selenium for Python and run your first test on 3,000+ browsers with TestMu AI. TestMu AI (formerly LambdaTest) lets you run Python Selenium tests in the cloud without keeping browsers on your Mac.

python.org Python Releases for macOS download page

Install Python with Homebrew

Homebrew installs Python on a Mac with one command. Don't have Homebrew yet? First install Homebrew, then run:

brew install python
python3 --version

Homebrew's Python comes with pip. brew upgrade updates Homebrew's Python; for a new minor version, install it with brew install python@3.x (the version you need). Homebrew marks this Python as externally managed, so install packages in a virtual environment (see below) rather than with a plain pip install.

Which to choose: the python.org installer is the simplest start and matches the official documentation, while Homebrew suits developers who already manage their tools with brew. Pick one, so two installs don't compete for the python3 command.

Manage several Python versions with pyenv

pyenv installs several Python versions on one Mac and switches between them per project. Install it with brew install pyenv, add the shell setup lines from pyenv's README to your ~/.zshrc, then run pyenv install <version> and pyenv local <version> in a project folder (or pyenv global <version> to set a default). Most people need only one Python; reach for pyenv when different projects need different versions. Full setup steps are in the pyenv README on GitHub.

python vs python3 on Mac

On a Mac, type python3, not python. Apple removed Python 2 in macOS Monterey 12.3, and with it the python command, and the python.org installer adds python3 rather than python. The same goes for pip: on a Mac it's usually pip3, or python3 -m pip.

If you want python to work, add alias python=python3 to your ~/.zshrc file and open a new Terminal window. Inside an activated virtual environment, python already points to that environment's Python 3.

Add pip packages safely with a virtual environment

A virtual environment keeps each project's pip packages in its own folder, so installs never touch Homebrew's or Apple's Python. Create one per project:

cd ~/projects/myapp
python3 -m venv .venv
source .venv/bin/activate
python -m pip install requests
deactivate

While the environment is active, python and pip point into .venv; deactivate switches back. Both the python.org and Homebrew Pythons include pip; if yours doesn't, see how to install pip.

Uninstall Python from a Mac

How you uninstall Python from a Mac depends on how you installed it. Never delete Apple's /usr/bin/python3: macOS manages it.

  • python.org installer: drag the Python 3.x folder from Applications to the Trash, delete that version's folder in /Library/Frameworks/Python.framework/Versions/, and remove the links in /usr/local/bin that point to it. List those links with ls -l /usr/local/bin | grep Python.framework.
  • Homebrew: run brew uninstall python, or the versioned formula name that brew list shows.
  • pyenv: run pyenv uninstall <version>.

Frequently Asked Questions

Does macOS come with Python?

Not as a full install for development. Typing python3 on a Mac without developer tools offers to install Apple's Command Line Tools, which include a python3 that macOS manages. For your own projects, install the latest Python from python.org or with Homebrew.

Should I use Homebrew or python.org?

Use the python.org installer if you're new to Python or want the official build. Use Homebrew if you already manage your tools with brew and want brew upgrade to update Python. Pick one, so you don't end up with two Pythons fighting over the python3 command.

Why does python not work on my Mac?

macOS doesn't include a python command. Type python3 instead, or add alias python=python3 to your ~/.zshrc file.

How do I update Python on Mac?

Download and run the newest installer from python.org, or run brew upgrade if you installed with Homebrew; for a new minor version, install it with brew install python@3.x (the version you need). A new minor version from python.org installs next to the old one, which you can then remove.

What does Install Certificates do?

It installs a set of SSL root certificates for the python.org Python, so Python can verify HTTPS websites. Without it, HTTPS requests from Python can fail with CERTIFICATE_VERIFY_FAILED errors.

Related Questions

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests