4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more

How to update Python version?

By 4Geeks

Install the latest Python next to the one you have, point your terminal and your projects to it, and fix the usual errors with help from AI.

7 min readLast updated
Update Python icon

How do I update Python?

Short answer: To update Python, install the new version next to the one you have and point your projects to it. The latest release is Python 3.15.2, from October 25, 2026. On Windows, run py install 3.15 with the Python install manager, or download the installer from python.org. On macOS, run brew install python@3.15 or use the python.org installer. On Ubuntu, add the deadsnakes PPA and run sudo apt install python3.15; on Fedora, run sudo dnf install python3.15. Then check it with python --version and reinstall your packages with pip.

Updating Python almost never replaces the old version. Each minor version, such as 3.14 or 3.15, installs in its own folder with its own packages. So the real question is not only how to install 3.15, but how to make your terminal and your projects use it.

There are two kinds of update:

  • Patch update, for example 3.15.1 to 3.15.2: bug and security fixes. It replaces the previous patch and keeps your packages. Install it whenever one comes out.
  • Minor update, for example 3.14 to 3.15: new features. It installs next to the old version, and you move your projects to it one by one.

How Python is updated on each system: the Python install manager on Windows, Homebrew on macOS and the deadsnakes PPA on Ubuntu. Each one ends by checking the new version.

Update Python at a glance

SystemRecommended wayCommand
WindowsPython install managerpy install 3.15
macOSHomebrew or the python.org installerbrew install python@3.15
Ubuntudeadsnakes PPAsudo apt install python3.15
Fedoradnfsudo dnf install python3.15
Any systemuvuv python install 3.15

Before you start, check which version you have with python --version, or python3 --version on macOS and Linux. For more detail, see how to check your Python version.

Update Python on Windows

python.org recommends the Python install manager to get Python on Windows. It installs, updates and removes versions from the terminal with the py command.

  1. Install the Python install manager from the Microsoft Store, from python.org/downloads or with winget:
powershell
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
  1. Install the new version:
powershell
py install 3.15
  1. Check which versions you have and which one runs by default:
powershell
py list
python --version

To get the latest patch of the versions you already have, run py install --update. It replaces each install with the newer patch and leaves your site-packages folder as it is. To run a specific version, use py -V:3.15.

Other ways on Windows

  • Standalone installer: on python.org/downloads/windows, download the Windows installer (64-bit), or ARM64 if your PC has an ARM processor. Check Add python.exe to PATH on the first screen.
  • Chocolatey: if you already use it, run choco upgrade python -y in PowerShell as administrator.

Update Python on macOS

macOS includes a python3 from Apple's command line tools, usually an old version. Do not remove it: install the new version next to it.

With Homebrew:

bash
brew update
brew install python@3.15
python3.15 --version

Later, brew upgrade python@3.15 installs the new patches of that version.

With the python.org installer: download the macOS installer from python.org/downloads/macos, open the .pkg file and follow the steps. Then run python3 --version in a new terminal.

With pyenv, if you switch versions between projects:

bash
brew install pyenv
pyenv install 3.15.2
pyenv global 3.15.2

If pyenv install fails with C compiler cannot create executables, install Apple's command line tools with xcode-select --install and try again. More details in what is pyenv and how to install it.

Update Python on Linux

Linux uses Python for its own tools, so never replace or remove the system python3. Install the new version next to it and call it by its full name, such as python3.15.

Ubuntu 22.04, 24.04 and 26.04, with the deadsnakes PPA:

bash
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.15 python3.15-venv
python3.15 --version

Fedora:

bash
sudo dnf install python3.15
python3.15 --version

Update Python on any system with uv

uv installs Python the same way on Windows, macOS and Linux, without touching the system version:

bash
uv python install 3.15
uv python upgrade

uv python upgrade updates every version installed with uv to its latest patch.

Career · AI Engineering

Updating Python is step one, building with AI is next

From zero to junior AI Engineer: Python, AI agents and RAG with mentors and real projects.

Update Python with AI

An AI assistant such as ChatGPT, Claude or GitHub Copilot saves you time when the update does not go as planned. Give it your system, the version you have and the exact error. These three prompts are ready to copy.

1. Plan the update for your system

I use [Windows 11 / macOS 15 / Ubuntu 24.04] and python --version shows [3.12.4].
I want Python 3.15 without breaking my current projects.
Give me the exact commands for my system, how to check that it worked,
and how to keep my old version for the projects that still need it.

2. Fix "python still shows the old version"

I installed Python 3.15 but python --version still shows [3.12.4].
This is the output of [where python / which -a python3]:
[paste the output]
Explain which executable my terminal is using and how to fix the PATH,
step by step, without uninstalling anything.

3. Move a project to the new version

I have a project with a requirements.txt that runs on Python [3.12].
Give me the commands to create a virtual environment with Python 3.15,
reinstall the dependencies and spot the packages that are not compatible yet.
Here is my requirements.txt:
[paste it]

Read every command before you run it, especially the ones that use sudo or change the PATH.

After updating: move your packages and projects

Each minor version has its own packages, so a project that worked with 3.14 will not find its libraries in 3.15. Move it like this:

  1. With the old version, save the list of packages: python -m pip freeze > requirements.txt
  2. Create a virtual environment with the new version: python3.15 -m venv .venv, or py -V:3.15 -m venv .venv on Windows.
  3. Activate it with source .venv/bin/activate, or .venv\Scripts\activate on Windows.
  4. Update pip and reinstall the packages:
bash
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

If a package fails to install, it may not support 3.15 yet. Keep that project on the previous version until it does.

Learn with a mentor

Set up Python like a real team does, not just in tutorials

In the 4Geeks AI Engineering career program you start with no experience and finish with AI agents and RAG systems in your portfolio.

Common errors when updating Python

ErrorCauseFix
python --version still shows the old versionYour terminal finds the old executable first in the PATHOpen a new terminal. Check with where.exe python on Windows or which -a python3 on macOS and Linux. On Windows, py list shows the default version
'python' is not recognized on WindowsPython is not in the PATHInstall the Python install manager, or run the installer again with Add python.exe to PATH checked
error: externally-managed-environment when you run pipLinux and Homebrew protect their Python packagesCreate a virtual environment with python3.15 -m venv .venv and install inside it
ModuleNotFoundError after updatingYour packages are in the old versionReinstall them with the new one: python -m pip install -r requirements.txt
C compiler cannot create executables with pyenv on macOSApple's command line tools are missingRun xcode-select --install and repeat pyenv install
Free download

Update Python on any system with a 2-page cheat sheet

The commands for Windows, macOS and Linux, how to check which version runs, how to move your packages, the most common errors and prompts for ChatGPT, Claude or Copilot. Free, in PDF.

Update Python cheat sheet: Windows, macOS and Linux

2 pages · PDF · 4Geeks

  • The update commands for Windows, macOS, Ubuntu, Fedora and uv
  • How to move your packages and projects to the new version
  • The 5 most common errors and prompts to fix them with AI

Get it free

Your PDF right away

Frequently asked questions about updating Python

Want to go from updating Python to building AI agents, with real projects and mentors?

See the AI Engineering program