Skip to content

Python 3.15.1 Security Update: Fix pip and Existing Virtual Environments

Python 3.15.1 updates pip to address a certificate-trust security incident, but existing virtual environments need separate attention. Learn how to update pip and certifi, verify package versions, and check uv-managed installations.

Python 3.15.1 Security Update: Fix pip and Existing Virtual Environments

On this page

Updating Python does not automatically repair every project environment on your computer. Python 3.15.1, released on October 21, 2026, includes an updated package installer to address a certificate-trust security incident, but existing virtual environments need attention too. This tutorial walks through checking your Python installation, updating pip and certifi safely, and verifying that your projects use the corrected packages without unnecessarily reinstalling their dependencies.

Why Python 3.15.1 requires more than a routine update

The Python Software Foundation released Python 3.15.1 alongside Python 3.14.9 and Python 3.13.17 as security-focused updates. All three releases include pip 26.2.2, which bundles an updated version of certifi, the package that provides a collection of trusted certificate authorities for verifying secure connections. The update addresses a problem involving eMudhra's emSign certificate hierarchy, where compromised intermediate certificate keys created a risk for software that still trusted the affected root certificate.

The distinction between a certificate authority and a certificate store matters here. A certificate authority helps establish that a server is who it claims to be, while a certificate store contains the trusted certificates an application uses to make that decision. According to the GitHub Security Advisory Database, certifi versions before 2026.10.19 were affected by the issue, and version 2026.10.19 removes the relevant trust. If an application relies on an outdated certificate bundle, an attacker positioned to intercept its network traffic could potentially exploit that trust to impersonate a website.

The Python release notes recommend updating pip and uv in existing virtual environments. A virtual environment is an isolated directory containing a project's Python packages, so updating the main Python installation does not necessarily update the tools already installed in those directories. That is why installing Python 3.15.1 alone is not a complete fix for every developer machine.

Check which Python installation your terminal is using

Before installing anything, open a terminal or command prompt and check the interpreter version. On Windows, use the Python launcher where available; on macOS or Linux, use the versioned executable if multiple Python installations are present. These commands help you avoid updating one interpreter while your project continues to use another.

# Windows
py -3.15 --version
py -3.15 -m pip --version

# macOS or Linux
python3.15 --version
python3.15 -m pip --version

A Python 3.15.1 installation should report version 3.15.1, although a machine may still have other Python versions installed. The pip command also identifies the package installer and its location. If the location points into a project's virtual environment, you are checking that environment rather than the global installation; if it points to a system directory, you may be checking the base interpreter instead.

If Python 3.15 is not installed, obtain Python 3.15.1 through the official Python distribution for your operating system. Windows users can use the Python install manager or the traditional installer, which remains available during the 3.15 release series. macOS users should use the official macOS installer, while Linux users should check whether their distribution supplies the required maintenance release before replacing a system-managed interpreter.

Update pip and certifi in each existing virtual environment

Move into your project directory and activate its virtual environment before upgrading packages. On Windows, a typical PowerShell command is ..venv\Scripts\Activate.ps1; on macOS or Linux, use source.venv/bin/activate. Your environment may have a different directory name, so adjust the path to match your project. Once activated, check that the terminal prompt or executable path identifies the intended environment.

Run the following command to upgrade pip and certifi in that environment. Using python -m pip ensures that pip runs through the active Python interpreter rather than accidentally targeting another installation.

python -m pip install --upgrade pip certifi

The command updates two separate pieces. The pip upgrade replaces the installer and its bundled dependencies, including the certificate bundle used by pip; the certifi upgrade updates the package that Python applications such as those using requests may use directly. Updating both is a practical way to cover the common cases, although applications that use a separate operating-system or custom certificate store may need their own checks.

When the command finishes, pip should report that the packages were installed or that the requested versions are already satisfied. If you maintain several projects, repeat the process in each virtual environment that uses an affected package version. Updating one environment does not update its neighbours, even when all of them use the same underlying Python installation.

Verify that the corrected packages are installed

Check the versions from inside the activated environment rather than relying on the output from a global Python command. The following commands show the installed pip and certifi versions and identify the location of the certifi certificate bundle.

python -m pip --version
python -m pip show certifi
python -c "import certifi; print(certifi.__version__); print(certifi.where())"

For the certificate-bundle fix, look for certifi version 2026.10.19 or later and confirm that the printed path belongs to the environment you intended to update. The pip release bundled with the Python 3.15.1 installer is 26.2.2, but a later compatible pip version may be installed through a normal package upgrade. The goal is to use a corrected certificate bundle, not to force every environment to remain permanently on one installer version.

These checks establish package versions and file locations, but they do not prove that every application is using certifi. Some libraries use their own certificate configuration, and others rely on the operating system's trust store. If an application sets a custom certificate path or uses a separate networking runtime, inspect that configuration before concluding that the update covers its connections.

Handle an old pip that cannot upgrade normally

In some circumstances, the installed pip may fail to upgrade itself through the usual package index because its current certificate bundle prevents it from establishing a trusted connection. Python's official 3.15.1 release page provides a specific fallback command that installs pip 26.2.2 from a package file with a published SHA-256 hash. Use the command supplied by the official release page rather than copying a package URL from an unverified forum post.

The fallback is intended for a virtual environment where the normal upgrade path cannot be used. Run it with that environment's Python interpreter and verify the resulting pip and certifi versions afterward. Do not disable certificate verification or configure pip to trust every host as a shortcut; doing so removes a security control precisely when the environment needs a trustworthy update.

If the upgrade fails with a network error, first determine whether it is a certificate-verification problem, a proxy restriction, or a connectivity failure. A corporate proxy may require an organisation-approved certificate configuration, while an offline computer may need the package downloaded through a trusted machine and transferred securely. The right fix depends on the error, so avoid treating every installation failure as evidence of the same certificate issue.

Update uv-managed Python installations separately

Some developers use uv, a Python package and project manager that can also install and manage Python interpreters. Updating pip inside a conventional virtual environment is not the same operation as updating uv or the Python build managed by uv. The uv project's release information specifically advises users to upgrade uv and then update managed Python installations, while warning that environments pinned to older Python patch versions do not automatically switch to the corrected interpreter.

If you use uv, update the tool using the installation method you originally chose. For installations managed by uv itself, the usual command is uv self update; package-manager installations may instead need to be updated through their package manager. Then check the installed Python versions and use uv's Python upgrade command where appropriate. Finally, update pip in any existing virtual environment that remains tied to an older interpreter.

uv --version
uv self update
uv python list

These commands let you check the tool version and inspect the Python installations uv knows about. Do not assume that upgrading uv automatically replaces every interpreter or repairs every existing project environment. Check the environment's actual Python version and package versions after the update, particularly when a project deliberately pins its runtime for compatibility.

Know when to upgrade the interpreter and when to update packages

Installing Python 3.15.1 is the cleanest route for a project already targeting Python 3.15, but it may not be appropriate for software that depends on Python 3.13 or 3.14. The corresponding security releases, Python 3.13.17 and Python 3.14.9, also include the updated pip and certificate bundle. Choose the maintained release for the Python series your application supports instead of changing major or minor versions simply to obtain the security correction.

There is another reason to check the project rather than just the interpreter: a requirements file or lockfile may pin application dependencies without pinning the Python installer itself. Updating pip and certifi in the environment generally does not require rewriting that application dependency list. However, teams that recreate environments in continuous integration or deployment should ensure their setup process installs a corrected Python build and does not immediately restore outdated packaging tools from a cached environment.

After updating, run the project's tests and perform a real HTTPS request against a service it normally uses. A successful package-version check is useful, but a small integration test can expose a custom certificate configuration that the basic checks miss. If the project runs in containers, update the relevant image or environment separately; changing the Python installation on your workstation does not change packages inside an already-built container.

Make the security update part of your environment checks

Start with the environments that install packages from the internet or make authenticated HTTPS requests, then check the remaining development environments and build systems. Keep a record of which interpreter and certificate package each project uses, and rerun the checks when rebuilding a development container or deployment image. This is a small maintenance task, but it prevents a freshly updated workstation from giving a false sense of security while an old environment continues using a stale certificate bundle.

The key action is to update pip and certifi in each affected environment, not simply to install a new Python executable and assume the work is finished. Python 3.15.1 supplies a corrected default for new installations, while existing environments need their own package maintenance. If an environment cannot be updated through the normal package index, use the official release instructions and verify the result before returning it to development or production use.

Copy this post

0 Comments

No comments yet. Be the first to share your thoughts.

Join the conversation

Log in or create a free account to leave a comment. You can edit or delete your own comments any time.