Python upgrade
Windows 10
Python installation
update Python
Python setup

How do I upgrade the Python installation in Windows 10?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Upgrading Python on Windows 10 is usually a matter of installing a newer release from python.org, but the installer is only part of the job. The real work is confirming which interpreter your shell uses, whether the Python launcher still points to the expected version, and whether your virtual environments need to be rebuilt.

Check the Current Installation First

Before changing anything, identify what is already installed. Windows systems often have more than one Python interpreter, especially if one came from the Microsoft Store and another came from the official installer.

powershell
1python --version
2py --version
3where python
4py -0p

where python shows the executables found on PATH. py -0p lists interpreters known to the Python launcher. If these commands point at different locations, fix that confusion before you upgrade.

Upgrade with the Official Installer

The cleanest route is to download the new installer from python.org and run it. If the existing installation came from the official Windows installer, the setup program usually offers an upgrade path.

During installation, pay attention to these choices:

  • keep the launcher installed
  • install for all users only if that matches your machine setup
  • add Python to PATH only if you actually rely on python directly in the shell

After installation, verify the result.

powershell
py --version
python --version

If py shows the new version but python still shows the old one, the upgrade succeeded and your PATH order is the real issue.

Prefer the Python Launcher on Windows

On Windows, py is often more reliable than python because it is designed to select the correct interpreter even when several versions are installed.

powershell
py -3.12 -m pip --version
py -3.12 script.py

This avoids accidental use of an outdated interpreter left earlier in PATH. For team documentation and automation, py -3.x is usually clearer than assuming a single global python command.

Recreate Virtual Environments After a Major Upgrade

A virtual environment is tied to the interpreter it was created with. If you upgrade from one minor version to another, such as 3.11 to 3.12, the safest approach is to create a new environment instead of trying to patch the old one.

powershell
1py -3.12 -m venv .venv
2.\.venv\Scripts\activate
3python --version
4python -m pip install --upgrade pip

Then reinstall dependencies from your lock file or requirements file.

powershell
pip install -r requirements.txt

This keeps compiled packages and interpreter metadata consistent.

Upgrade pip Separately

The Python installer upgrades the interpreter, not necessarily every package-management tool you use daily. After switching to the new interpreter, update pip inside that interpreter.

powershell
py -3.12 -m pip install --upgrade pip setuptools wheel

Use py -3.12 -m pip instead of plain pip when you want to be explicit about which Python installation owns the packages.

A Practical End-to-End Check

A quick smoke test confirms that the new interpreter, package manager, and scripts are aligned.

powershell
py -3.12 -c "import sys; print(sys.executable); print(sys.version)"
py -3.12 -m pip --version

If the executable path and the pip path both live under the same Python installation, the upgrade is operational.

Common Pitfalls

The biggest mistake is assuming that installing a new Python version automatically changes every shell, editor, and virtual environment on the machine. It does not. Another common problem is mixing Microsoft Store Python with the installer from python.org, which can make where python output look inconsistent.

Do not try to copy package directories from the old installation into the new one. Binary wheels and compiled extensions can break across versions. Reinstall packages cleanly in each environment instead. Also avoid editing PATH repeatedly unless you know exactly why; on Windows, the launcher usually removes the need for fragile manual path ordering.

Summary

  • check python, py, and where python before upgrading
  • use the official installer from python.org for a straightforward upgrade path
  • prefer py -3.x on Windows when multiple interpreters may exist
  • recreate virtual environments after upgrading to a new Python minor version
  • upgrade pip separately and verify the interpreter and package paths match

Course illustration
Course illustration

All Rights Reserved.