Install the Latest Python on macOS (M1/M2/M3) in Minutes
This step‑by‑step guide shows how to check the pre‑installed Python version on any macOS device, install Homebrew, use it to install the newest Python release, configure PATH, add optional libraries and choose an IDE, with troubleshooting tips for common issues.
Reading font

Prerequisites
MacBook running macOS (including Intel, M1, M2, M3, M4) with administrator access.
Check pre‑installed Python version
Open Terminal (⌘+Space, type “Terminal”) and run python3 --version. If a version such as Python 3.x.x appears, Python 3 is already present; otherwise you need to install it.
If a dialog asks to install the Command Line Tools, click “Install” and wait for the download.
Install Homebrew (macOS package manager)
Run the following command in Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Follow the on‑screen prompts, entering your password when requested.
Verify the installation with brew --version. If an older version is reported, update Homebrew:
brew update
Install the latest Python via Homebrew
In Terminal run: brew install python Wait for the process to finish, then confirm the installed version (e.g., Python 3.13) with: python3.13 --version Check that pip is available:
pip3 --version
Add Python to PATH (if necessary)
Edit your shell profile ( ~/.zshrc for Zsh or ~/.bash_profile for Bash) and append:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"Save the file and reload the profile: source ~/.zshrc Verify the change with python3 --version.
Install optional Python libraries
Common libraries include NumPy, Pandas, Flask, and Matplotlib. Install any library with:
pip3 install library_name
Choose an IDE (optional)
Beginner‑friendly IDEs: GeeksforGeeks IDE, Visual Studio Code, PyCharm.
Common issues and troubleshooting
“command not found” – ensure Homebrew is installed and Python is on PATH.
Installation incomplete – reinstall with brew reinstall python.
Homebrew errors – run brew doctor and follow the suggestions.
FAQ
Run Python in Terminal with python3 and exit with exit().
Install a specific version (e.g., 3.13) from the official Python website.
Verify installations with python3 --version or pip3 --version.
For questions about attribution, corrections or content rights, please contactand we will review it promptly.