Python on Mac
Python for Mac. All about setting up and managing Python on macOS: installing Python, checking what you already have, version managers, package managers, virtual environments, and fixing the common errors.
Python is among the most popular programming languages, with readable, simple syntax and software libraries for almost everything. However, it is more difficult to install and set up a project than newer languages, because of a bewildering ecosystem of competing tools. Here's a guide:
- Just want Python installed? See How to install Python on Mac.
- Not sure what you already have? See Check if Python is installed.
- Something is broken? See command not found: python or error: externally-managed-environment.
Python is one part of setting up a Mac for development. See the roadmap for everything else.
Before you get started
You'll need a terminal application to install Python. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.
Installing Python
- How to install Python on Mac covers which method to choose, and why.
- Check if Python is installed explains the macOS system Python, and why not to use it.
- Download Python for Mac covers the official python.org installer, and when to skip it.
- Install Python with Homebrew is the fastest way to a working Python.
- Install uv on Mac is the best way if you are writing code.
- Brew install uv shows how to install uv with Homebrew.
- Install Python with Pyenv is the traditional version-manager route.
- Install Pipx is for running stand-alone Python applications.
- Install Pip on Mac describes the package manager that comes with Python, and how to check, repair, and use it.
- Update Python shows how to move to a newer version.
Using Python
- uv for Python on Mac handles versions, packages, and environments in one tool.
- Mac PATH for Python explains which
pythonactually runs, and how to control it. - Alias python3 to python.
- Uninstall Python on Mac covers removing Homebrew, python.org, pyenv, or uv versions safely.
- Rye is archived, use uv instead.
Common errors
- zsh: command not found: python
- zsh: command not found: pip
- zsh: command not found: uv
- error: externally-managed-environment
Why Python needs so many tools
Python has been evolving since 1991, and unlike newer languages it never settled on one official toolchain. That is the root of most Mac Python confusion: you'll see four tutorials recommend four different tools, and none of them are exactly wrong. Three kinds of tool do the work.
Version managers let you install several Python versions and switch between them, so one project can stay on 3.11 while another moves to 3.13. uv has this built in, and Pyenv is the traditional choice. Mise and Asdf handle multiple languages at once.
Package managers install libraries and resolve their dependencies. Pip is the standard one, included with Python since 3.4, and it reads a requirements.txt. Newer tools use pyproject.toml instead, the file that plays the role of Node's package.json or Ruby's Gemfile. Alternatives include Poetry, PDM, Pipenv, and Conda.
Environment managers give each project its own isolated set of packages. This is the part that surprises people coming from other languages: pip installs globally by default, so without a virtual environment, a project needing version 1.0 of a library and a project needing 2.0 will break each other. Venv is built in, and Virtualenv is the third-party alternative. It is also why modern Python refuses global installs outright with error: externally-managed-environment.
The reason uv is now the common recommendation is that it is all three at once, so you do not have to assemble the set yourself.
Learning Python
Due to Python's popularity, there are hundreds of courses, books, and videos for getting started with Python. Here is the book I recommend for beginning programmers:
If you are coming to Python from another programming language, try:
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.