Skip to content
Runbook

Install Python on macOS

General-purpose programming language and runtime, batteries included.

Runtimelanguageruntimescriptinginterpreter

Installation

Python (Homebrew) · Homebrew
brew install python

Installs the latest python@3.x, with pip3.

Verify the installation

Verify
python3 --version

Important files

TypePathDescription
binary/opt/homebrew/bin/python3Python 3 interpreter (Apple Silicon; /usr/local/bin on Intel).

Command-line tools

  • python3The Python 3 interpreter.
  • pip3Package installer for Python.
  • venvStandard-library module to create virtual environments (python3 -m venv).

Uninstall

Uninstall
brew uninstall python

Good to know

  • Homebrew installs the latest python@3.x; the command is python3 (not python).
  • Create isolated environments with python3 -m venv .venv then source .venv/bin/activate.
  • For multiple versions side by side, use pyenv (brew install pyenv).

Installation with Homebrew

brew install python installs the current Python 3 (the python@3.x formula) together with pip3. The interpreter lives in /opt/homebrew/bin/python3 on Apple Silicon and /usr/local/bin/python3 on Intel; check brew --prefix if the command is not found.

Virtual environments

Do not install project dependencies globally. Create a per-project environment with python3 -m venv .venv, activate it with source .venv/bin/activate, then use pip install. Deactivate with deactivate.

Managing multiple versions

If you need several Python versions, install pyenv (brew install pyenv) rather than stacking Homebrew formulae; it lets you pin a version per directory with a .python-version file.