How to Update Python on Mac

Harold Sep 19, 2026

Updating Python on a Mac is a straightforward process, thanks to the Homebrew package manager — a must-have tool for macOS. This guide will walk you through the steps to ensure you have the latest version of Python and its essential packages.

How to Update Python on Windows, Mac, & Linux – Easy Guide | Coding Framework
How to Update Python on Windows, Mac, & Linux – Easy Guide | Coding Framework

Before we dive in, ensure you have Homebrew installed. If not, open your terminal and paste this command to install it: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

How to Install Python 3.13.7 on macOS Monterey to macOS 26 Tahoe
How to Install Python 3.13.7 on macOS Monterey to macOS 26 Tahoe

Updating Python via Homebrew

Homebrew makes updating packages, including Python, a breeze. Let's learn how to update Python on your Mac using Homebrew.

How to Built a Desktop App with Python | Full Walkthrough
How to Built a Desktop App with Python | Full Walkthrough

First, ensure your Homebrew system is up-to-date. Run the following commands one by one:

  1. brew update
  2. brew upgrade (or brew upgrade --formula package_name for a specific package)
Effortless Python Management on macOS
Effortless Python Management on macOS

Upgrading Python

To upgrade Python, you can use the brew upgrade command. However, before that, let's check the currently installed version:

python3 --version

Python tuple update tutorial infographic
Python tuple update tutorial infographic

Once you've noted down the version, run the following command to update Python:

brew upgrade python3

After the upgrade, verify the new version using the python3 --version command.

Updating Python Packages

How to Install pip on MacOS
How to Install pip on MacOS

Updating Python packages can be done using pip, Python's built-in package installer. You can update all your packages at once with:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U

Python Tutorial: Iterators and Iterables - What Are They and How Do They Work?
Python Tutorial: Iterators and Iterables - What Are They and How Do They Work?
How to Setup Python Environment Variables In Windows 10
How to Setup Python Environment Variables In Windows 10
5 Easy Ways to Install Python on Windows
5 Easy Ways to Install Python on Windows
programming Archives | Cult of Mac
programming Archives | Cult of Mac
Python 404
Python 404
Advanced Web Scraper
Advanced Web Scraper
a book cover with the title python file 10 exercises
a book cover with the title python file 10 exercises
6 Things You Didn’t Know You Could Do on Your Mac
6 Things You Didn’t Know You Could Do on Your Mac

This command lists all outdated packages, filters out local (editable) packages, and updates them one by one.

Managing Python Versions with pyenv

While Homebrew ensures you have a stable version of Python, you might want to manage multiple versions for different projects. This is where pyenv comes in handy.

First, install pyenv using Homebrew by running brew install pyenv

Installing specific Python versions

To install a specific Python version (e.g., 3.9), use this command:

pyenv install 3.9

Setting the local Python version

To use a specific Python version in your current project, activate it using:

pyenv local 3.9

This command creates a .python-version file in your current directory, keeping the Python version persistent.

And there you have it! You've successfully updated Python on your Mac using Homebrew and learned how to manage different Python versions with pyenv. Happy coding!