Python

Written & tested for accuracy by a developer (not AI)

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:

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

Using Python

Common errors

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.