Safeguard
Supply Chain Security•

How to Install Python and pip on Windows and Linux, Safely

Install Python on Windows with the Python install manager and on Linux from your distro, check pip, verify the download with Sigstore, and use a venv.

Safeguard Security Team
33 min read

On Windows, install Python with the Python install manager from python.org or the Microsoft Store, then run py install. On Ubuntu, Debian and Fedora, use the Python your distribution ships and add packages through its package manager. pip comes with both. Verify python.org downloads with Sigstore, and install project packages into a virtual environment.

Python is the most searched install on the web for a reason: almost every data, scripting and automation course starts with it. It is also one of the easiest installs to get subtly wrong. You can end up with three interpreters on one PATH, a pip that installs into the wrong one, a system Python on Linux you have quietly damaged, or an installer that came from a site that only looks like python.org. This guide covers Windows 10 and 11 and the main Linux families, using only commands from the official Python, pip, packaging, Microsoft and distribution documentation, each linked in the Sources section. If you are on a Mac, read our macOS install guide instead.

Key takeaways

  • The official sources are python.org, docs.python.org, pypi.org, pip.pypa.io, packaging.python.org and the Microsoft Store listing for the Python install manager. Anything else that offers you a "Python download" is a third party.
  • On Windows, the Python install manager is now the recommended route. The legacy full installer is deprecated since 3.14 and will not be produced for Python 3.16 or later.
  • On Linux, never remove or replace the distribution's python3. Install extra versions alongside it, and build from source with make altinstall, not make install.
  • pip ships with Python. Use python -m ensurepip --upgrade (or py -m ensurepip --upgrade on Windows) to restore it; it does not touch the internet.
  • From Python 3.14 onward, Sigstore is the only signing method for release artifacts. Python 3.13 and older also carry OpenPGP signatures. Windows binaries are Authenticode signed to the Python Software Foundation.
  • "error: externally-managed-environment" on Linux is PEP 668 working as intended. The answer is a virtual environment or pipx, not --break-system-packages.
  • As of 23 October 2026, Python 3.15 and 3.14 get bug fixes, 3.11 to 3.13 get security fixes only, and 3.10 reached end of life on 1 October 2026.

Which Python should you install?

There are more legitimate ways to get CPython than there were five years ago. They are not interchangeable.

RoutePlatformWho maintains itBest forWatch out for
Python install manager (Microsoft Store or python.org MSIX)Windows 10 and 11Python core teamMost Windows users and developers who need several versionsRuntimes install per user only
Python install manager MSIWindows Server 2019, locked down machinesPython core teamServers without MSIX supportNo user interface; per machine install to Program Files only
Legacy full installer (python-3.x.y-amd64.exe)WindowsPython core teamExisting scripted deployments using PrependPath=1 and similar optionsDeprecated since 3.14; not produced for 3.16 or later
winget packageWindowsWindows package managerScripted setupsThe two official guides use different package IDs
Distribution packages (apt, dnf)LinuxYour distribution's security teamServers, CI images, anything that must get distro security updatesVersion lags upstream; never remove the system python3
Source build with make altinstallLinux and UnixYouA version your distribution does not packageYou own every future patch
Version managers such as pyenvLinuxSeparate open source projectsSwitching between many versionsFollow that project's own docs for install and verification

If you are on Windows and unsure, use the Python install manager. If you are on Linux, start with your distribution's python3 and put everything for your project in a virtual environment. Ubuntu packages pyenv (sudo apt install pyenv), and newer all in one tools such as uv can also install interpreters; they are fine choices, but they have their own download sources and release processes, so follow their own documentation.

How to tell which Python you already have

The Python Packaging User Guide gives these checks:

# Linux and macOS
python3 --version
python3 -m pip --version
# Windows
py --version
py -m pip --version
py list

py list shows every runtime the Windows install manager manages. The pip check is the most useful one: it prints the pip version and the path of the Python it belongs to, so you can see whether "pip" and "python" point at the same installation. These are shell commands; typed at the >>> prompt of the Python REPL they fail with a syntax error.

Which sites are official, and how to avoid lookalike downloads

Most bad Python installs start with a search ad, a forum link or a "python download" page that is not python.org. Such a site can bundle extra software with the installer, serve an outdated version, or serve something that is not Python at all, and you cannot tell which from the page itself. The fix is to download only from the project's own domains.

What you needOfficial location
Installers, source tarballs, release noteswww.python.org/downloads/
Windows install managerwww.python.org/downloads/ or Microsoft Store product 9NQ7512CXL7T
Documentation, release statusdocs.python.org, devguide.python.org, peps.python.org
Packagespypi.org
pip docs; get-pip.pypip.pypa.io; bootstrap.pypa.io
Packaging guides, including pipxpackaging.python.org
Linux packagesYour distribution's repositories, through apt or dnf

Type python.org yourself or use a bookmark. On the Store, the install manager's product ID is 9NQ7512CXL7T, the same ID the Python docs use with winget. Check the file name: current Windows installers are named like python-3.15.1-amd64.exe, and the install manager is an .msix or .msi. Then verify the file as shown below before running it. For packages, check the exact project name on pypi.org first; our guide to verifying a PyPI package before install covers what to look at.

How to install Python on Windows 10 and 11, step by step

The Windows chapter of the Python documentation (3.15.1 edition) recommends the Python install manager, and says Python 3.15 supports Windows 10 and newer.

Route 1: the Python install manager (recommended)

  1. Get the install manager from the Microsoft Store listing, or download the MSIX from python.org/downloads and double click it. The docs say the two "are identical." From PowerShell you can also run:

    Add-AppxPackage <path to MSIX>
    
  2. Open a new terminal and install the current default runtime. default is a special tag; use py install 3.14 to pin a line instead.

    py install default
    
  3. On the first runtime install you will probably be asked to add %LocalAppData%\Python\bin to PATH. The docs call this optional; it gives you commands such as python3.14.exe.

  4. Optionally run the configuration checker, then confirm:

    py install --configure -y
    py list
    python --version
    py -m pip --version
    

python runs your default runtime, py -V:3.14 runs a specific one, and pymanager exec behaves like py if another tool has claimed that name. One limit for IT teams: the docs state the install manager does not install runtimes per machine, and each user installs their own. For a shared per machine interpreter, use the install manager MSI.

Route 2: winget

The Python docs install the install manager from its Store ID:

winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install --configure -y

Microsoft's "Python on Windows for beginners" guide (updated September 2026) instead installs one runtime package directly:

winget install Python.Python.3.14
python --version

Both are official, but they install different things. Pick one approach per machine so you do not end up with two copies of 3.14 that update separately.

Route 3: the legacy full installer

The python-3.x.y-amd64.exe installer still exists for 3.15, but the docs say it is "deprecated since 3.14" and "will not be produced for Python 3.16 or later." Install Now installs into your user directory and usually needs no administrator rights; Customize installation lets you pick features and do an all users install into Program Files. For a silent system wide install, the docs show this, run from an elevated prompt:

python-3.9.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0

Substitute the file you downloaded and verified. The documented /uninstall option removes Python without confirmation.

What "Add python.exe to PATH" actually does

PATH is the list of folders Windows searches when you type a command. If the folder containing python.exe is not on it, typing python fails or opens the Microsoft Store.

For the legacy installer, the docs describe the unattended options behind this choice. PrependPath=1 puts the install and Scripts directories at the front of PATH and adds .PY to PATHEXT; AppendPath=1 adds them at the end. Both default to 0. Microsoft's guide explains why front versus end matters: with the add to PATH option, the real python takes priority over Windows' built in Store shortcut, while installers that add python at a lower priority lose to it.

The install manager works differently. Its commands live in %UserProfile%\AppData\Local\Microsoft\WindowsApps, which Windows includes in PATH by default. Scripts that packages install live in each runtime's own scripts directory, which the docs say you add to PATH separately if you want them by name. Inside an activated virtual environment you need none of this.

The security point: whoever controls a folder early in PATH controls what python and pip mean. Keep PATH entries pointing at folders only you or administrators can write.

Long paths and WSL

Some packages exceed the old 260 character path limit. The docs say to enable the "Enable Win32 long paths" policy, or set LongPathsEnabled to 1 under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem, then reboot. On managed devices, let IT set it by policy.

If you work inside Windows Subsystem for Linux, follow the Linux section below; a WSL Python is completely separate from a Windows one.

How to install Python on Ubuntu, Debian and Fedora without breaking the system Python

On Linux, package managers and system scripts depend on the distribution's python3. Ubuntu's developer documentation says not to remove it, "as that would break system tooling." Leave the system interpreter alone, add what you need beside it, and keep project packages in virtual environments.

Ubuntu

Ubuntu's developer guide installs the full runtime with venv support, then pip:

sudo apt install -y python3-full
sudo apt install -y python3-pip python3-pip-whl

python3 tracks the release's default version; the guide's example shows it pointing at python3.12. If scripts expect a bare python command, Ubuntu suggests the python-is-python3 package.

Debian

The Debian wiki says a normal Debian install includes Python 3 (Trixie ships 3.13, Bookworm 3.11), and that python gives "command not found" unless you install python-is-python3. The wiki does not publish an install command list, so confirm exact package names on Debian's package search before scripting them. Since Bookworm, pip install outside a virtual environment stops with "error: externally-managed-environment"; the wiki suggests pipx for tools and mentions --break-system-packages without recommending it.

Fedora

Fedora's developer portal says Python 3 is preinstalled, and python and python3 both start it. System wide libraries are packaged with a python3- prefix, such as python3-requests. Fedora also packages other CPython versions side by side (its page lists 3.6 and 3.8 to 3.14, plus PyPy):

sudo dnf install python3.11
python3.11 -m venv env
source env/bin/activate
python -m pip install requests
deactivate

The page's example uses 3.9; the pattern is the same. It also warns: "For production purposes you should use the python3 package only."

Building from source, safely

The Python docs describe ./configure, make, make install, then warn that make install "can overwrite or masquerade the python3 binary" and recommend make altinstall, which installs only a versioned binary such as python3.15:

./configure
make
make altinstall

Verify the source tarball with Sigstore before you build, and remember that a self built interpreter gets no automatic updates; you rebuild it for every patch release.

Is pip included, and when do you need ensurepip or get-pip.py?

pip is included. The python.org installers, the install manager runtimes and python -m venv environments all come with it. On Ubuntu, the system pip is a separate package (python3-pip), but every virtual environment you create still gets its own pip.

If pip is missing or broken, pip's installation guide lists the supported ways to get it back, in this order.

1. ensurepip, the first choice. It is part of the standard library, and its docs state it "does not access the internet": everything needed to bootstrap pip is bundled with Python. That makes it the safest option.

# Linux and macOS
python -m ensurepip --upgrade
# Windows
py -m ensurepip --upgrade

The packaging guide also uses python3 -m ensurepip --default-pip (or py -m ensurepip --default-pip), which installs a plain pip script as well as the versioned pipX and pipX.Y scripts. ensurepip is an optional module; if your distribution removed it, its docs tell you to look at the distributor's documentation, which on Debian and Ubuntu means installing the venv and pip packages above.

2. get-pip.py, when ensurepip is not available. Download it only from https://bootstrap.pypa.io/get-pip.py, then run it:

python get-pip.py
py get-pip.py

Use this on interpreters you installed yourself. Do not run it against a distribution's system Python: pip's guide notes that pip from Linux package managers may be modified by the distribution and directs you to the distribution for help with it, and PEP 668 exists precisely to stop pip writing into that environment.

3. The zipapp, experimental. pip also publishes https://bootstrap.pypa.io/pip/pip.pyz, which you run with python pip.pyz --help. The docs say it "should not be used in production environments."

To upgrade pip itself:

python -m pip install --upgrade pip
py -m pip install --upgrade pip

Do this inside each virtual environment, not against the system Python on Linux. pip's current release supports CPython 3.10 to 3.15 and the latest PyPy3, testing the latest patch release of each.

pip or pip3?

pip and pip3 are just script names. On Linux, pip3 usually belongs to the system python3; pip may not exist, or may belong to something else. The reliable form on every platform is to run pip as a module of the exact interpreter you mean: python3 -m pip on Linux, py -m pip on Windows, or python -m pip inside an activated virtual environment. Every official guide quoted here uses that form.

How to verify a Python download

Verification answers two questions: did this file come from the Python release team, and has it changed since? python.org offers up to four checks.

MethodCoversProvesTool
Sigstore bundle (.sigstore)Every current release artifact; the only signing method from 3.14Signed by the named release manager identity, unchangedpython -m sigstore verify identity
OpenPGP signature (.asc)Releases up to 3.13Signed by the release manager's PGP keygpg --verify
AuthenticodeWindows installers and binariesSigned by the Python Software Foundation certificateGet-AuthenticodeSignature
SHA-256 checksumEvery file in the release tableMatches the value on python.orgGet-FileHash

A checksum only proves the file matches a value on a web page; a signature ties it to an identity. See checksums versus signatures for the difference.

Sigstore, for 3.14 and later (and most earlier releases)

python.org says release artifacts have been signed with Sigstore since 3.11.0, 3.10.7 and 3.9.14, and that "starting with Python 3.14, Sigstore is the only method of signing and verification of release artifacts." PEP 761, resolved in November 2024, made that change, citing the burden of protecting long lived PGP keys. Each release table links a .sigstore bundle per file. The expected signer depends on the line:

Python lineSigner identityOIDC issuer
3.11pablogsal@python.orghttps://accounts.google.com
3.12 and 3.13thomas@python.orghttps://accounts.google.com
3.14 and 3.15hugo@python.orghttps://github.com/login/oauth
3.16 and 3.17savannah@python.orghttps://github.com/login/oauth

Install the verifier, then run python.org's command with the identity and issuer for your line. For a 3.15 Windows installer:

python -m pip install sigstore
python -m sigstore verify identity \
  --bundle python-3.15.1-amd64.exe.sigstore \
  --cert-identity hugo@python.org \
  --cert-oidc-issuer https://github.com/login/oauth \
  python-3.15.1-amd64.exe

Success prints OK: followed by the file name. Always pass both identity and issuer; a valid bundle signed by someone else is exactly what you are trying to catch. On a brand new Windows machine with no Python yet, verify on another machine, use a standalone Sigstore client (python.org mentions one), or rely on Authenticode plus the checksum for the first install and use Sigstore from then on.

OpenPGP, for 3.13 and older

python.org says "Python versions before 3.14 are also signed using OpenPGP private keys of the respective release manager." Its OpenPGP page lists Pablo Galindo Salgado (key ID 64E628F8D684696D) for 3.11.x and Thomas Wouters (key ID A821E680E5FA6305) for 3.12.x and 3.13.x, and shows this pattern:

gpg --recv-keys [key ID]
gpg --verify Python-3.6.2.tgz.asc

PEP 761 says existing stable lines keep PGP signatures until end of life.

Authenticode and checksums on Windows

python.org states that "the Windows installers and all binaries produced as part of each Python release are signed" with an Authenticode certificate issued to the Python Software Foundation, subject CN = Python Software Foundation, O = Python Software Foundation, L = Beaverton, S = Oregon, C = US, issued since 14 October 2024 by the Microsoft Identity Verification Root Certificate Authority (earlier ones came from DigiCert). Check it, then compare the SHA-256 hash with the release table:

Get-AuthenticodeSignature -FilePath "$HOME\Downloads\python-3.15.1-amd64.exe" | Format-List
Get-FileHash "$HOME\Downloads\python-3.15.1-amd64.exe"

Status should be Valid with the PSF subject; blank fields mean unsigned. Get-FileHash defaults to SHA256. python.org notes that some installed executables, such as the default pip launcher, come from third party libraries and are not signed; the installer itself must be.

The release tables also link SPDX SBOMs for the source tarballs, Windows installers and embeddable packages, listing the third party components bundled into each build. That helps when an advisory lands for a bundled library; see using SBOMs during incident response.

Why virtual environments matter, and what PEP 668 means on Linux

A virtual environment is a directory with its own python and site-packages, so packages you install there do not touch the system or other projects. The venv docs say environments are disposable, "not checked into source control," and should be recreated rather than moved.

Create and activate one

# Linux and macOS
python3 -m venv .venv
source .venv/bin/activate
# Windows PowerShell (use .venv\Scripts\activate.bat in cmd.exe)
py -m venv .venv
.venv\Scripts\Activate.ps1

Type deactivate to leave. Activation is optional; scripts and scheduled tasks should call the environment's interpreter by full path. If PowerShell refuses to run Activate.ps1, the venv docs give Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser; on managed devices check your policy first. python -m venv --upgrade-deps .venv starts the environment with the latest pip.

"error: externally-managed-environment"

PEP 668, approved in June 2022, lets a distribution mark its Python as managed by the system package manager with an EXTERNALLY-MANAGED file in the standard library directory. Outside a virtual environment, pip then refuses to install and prints the distribution's message. The reason is practical: sudo pip install can replace a library apt or dnf installed and break system tools. Interpreters built from upstream source do not include the marker.

What you wantedWhat to do instead
A library for your projectCreate a venv and python -m pip install inside it
A command line applicationInstall it with pipx, which gives each app its own environment
A library for system wide scriptsInstall the distribution's python3- package
A Python version the distribution lacksInstall a packaged alternate version, or make altinstall

The spec allows --break-system-packages but says it should signal risk. Keep it for throwaway containers, never a workstation or server.

pipx for command line tools

The packaging guide installs pipx with python3 -m pip install --user pipx then python3 -m pipx ensurepath (on Windows, py -m pip install --user pipx and py -m pipx ensurepath). On a PEP 668 distribution the Linux form hits the externally managed error, so install the distribution's pipx package instead; the PEP 668 spec recommends distributions ship it. Then use pipx install PACKAGE, pipx upgrade PACKAGE and pipx uninstall PACKAGE.

Installing packages from PyPI safely

Installing Python is the smaller half of the risk. The packages you install next run code on your machine and become part of whatever you ship. A few of pip's own documented controls go a long way:

  • Hash checking mode. Pin each requirement with == and one or more --hash=sha256: values, then install with --require-hashes. pip then refuses anything whose hash does not match, including dependencies you forgot to list. Our guide to repeatable pip installs with hash checking shows the full workflow.
  • Wheels only. --only-binary :all: disallows source distributions, which are the packages that can run build code at install time. Read does pip install run code from packages for why that matters.
  • Install your own project with --no-deps. pip's secure installs page recommends python -m pip install --no-deps . so your project does not pull unlisted dependencies, and warns against python setup.py install and easy_install, which download "unchecked" anything you missed.
  • Preview first. Our post on previewing a pip install before you run it shows how to see what would be installed without installing it.
  • Never use sudo with pip. The packaging tutorial says it directly: "Do not run any of the commands in this tutorial with sudo."

How to keep Python and pip patched

How long each Python line gets fixes

The developer guide, following PEP 602, gives each minor version about two years of bug fix releases (18 months before 3.13), then "only security fixes are accepted and no more binaries are released," until five years after first release. As of 23 October 2026:

VersionStatusFirst releasedEnd of support
3.15Bug fix2026-10-092031-10
3.14Bug fix2025-10-072030-10
3.13Security fixes only2024-10-072029-10
3.12Security fixes only2023-10-022028-10
3.11Security fixes only2022-10-242027-10
3.10End of life (last release 3.10.22)2021-10-042026-10-01

Future dates can move. Because security only lines get no new binaries, new Windows installs should be 3.14 or 3.15. Anything on 3.10 or older is unsupported upstream unless your distribution backports fixes, which is the distribution's promise, not the core team's.

Patch releases matter

python.org calls 3.15.1, released 21 October 2026, an "expedited security release." It updates the bundled pip to 26.2.2 with certifi 2026.10.19, in response to the eMudhra and emSign certificate authority incident, and recommends upgrading pip in existing virtual environments. Our eMudhra CA key compromise explainer covers the incident. The lesson: updating the interpreter does not update the pip and certifi inside old environments.

Update commands

On Windows, py install --update with no tags updates every runtime the install manager manages. Then upgrade pip in each environment with python -m pip install --upgrade pip, or recreate it with --upgrade-deps. On Linux, Python patches arrive through normal distribution updates; source builds need a new verified download and make altinstall for each patch. For project dependencies, update requirements and reinstall, since that is where most Python vulnerabilities live.

How to uninstall Python cleanly

Windows, install manager

Remove a single runtime by its tag, or every runtime the install manager manages:

py uninstall 3.14
py uninstall --purge

The docs say --purge also removes Start menu entries, registry keys and download caches. The order matters: removing the install manager from Installed apps "does not remove any runtimes," so run py uninstall --purge first if you want everything gone.

Windows, legacy installer

Open Programs and Features (or Installed apps), select the Python version, choose Uninstall/Change, then Uninstall. The docs note this leaves the install manager, which has its own entry. For the deprecated legacy launcher, open Installed apps, search "Python launcher" and uninstall it. Afterwards, check that PATH no longer contains the old install and Scripts folders, and delete any virtual environments created from that interpreter, since they will not work without it.

Linux

Never remove the distribution's python3 package; Ubuntu's documentation says that would break system tooling. Remove only what you added:

  • Alternate versions installed through dnf or apt: remove them through the same package manager.
  • Source builds installed with make altinstall: delete the versioned binary and its library directory under the prefix you built with.
  • Virtual environments: delete the directory. The venv docs say they are disposable.
  • pipx apps: pipx uninstall PACKAGE.

On macOS, see our separate guide to uninstalling Python on a Mac.

Common errors and how to fix them

"'python' is not recognized as an internal or external command"

PATH has no Python. With the install manager, check that py and pymanager work and that PATH still contains %UserProfile%\AppData\Local\Microsoft\WindowsApps. With the legacy installer, rerun it, choose Modify and enable the PATH option, or use py. Open a new terminal after any PATH change.

Typing "python" opens the Microsoft Store

That is Windows' app execution alias. With the install manager, the docs say to open "Manage app execution aliases" from Start and make sure the "Python (default)" aliases are on, toggling them off and on to refresh. If you installed Python another way, Microsoft's guide says to switch the "App Installer" Python entries to Off.

pip installs a package but Python cannot import it

pip and python belong to different interpreters. Run python -m pip --version to see which, and always install with python -m pip (or py -m pip).

"Permission denied" or "Access is denied"

You are writing into a system wide Python. Microsoft's guide says to create a virtual environment and install there. Do not use sudo pip or an elevated prompt.

"error: externally-managed-environment"

Use a venv, pipx or your distribution's packages, as described above.

SSL: CERTIFICATE_VERIFY_FAILED

pip verifies HTTPS certificates to stop man in the middle attacks, and since pip 24.2 it uses the system certificate store in addition to certifi. Behind a TLS inspecting proxy, give pip your organisation's bundle with --cert or PIP_CERT, or add the root to the system store. Upgrade pip too, so certifi is current. Never fix this by turning verification off.

"No module named pip"

Run python -m ensurepip --upgrade, or on Debian and Ubuntu install python3-full or python3-pip for the system interpreter.

Where Safeguard fits, honestly

Safeguard does not install Python, verify installers or manage PATH, and none of the steps above depend on it. Where it helps is the step after installation, when your projects start pulling packages from PyPI.

Safeguard's software composition analysis is generally available for PyPI along with the other major ecosystems. Scanning a project with safeguard scan --dir ., or a container image with safeguard scan --image <name>, builds an inventory of the Python packages it contains, including transitive dependencies, and matches them against vulnerability databases. For container images, that inventory also includes the Python runtime packages the base image installed, so an image still built on an end of life Python line shows up next to the rest of its findings. Reachability analysis helps rank which vulnerable packages your code actually calls. When a fixed version exists, Griffin can open a pull request that updates the requirement, and that autonomous remediation ships switched off until you turn it on.

It does not replace the controls in this guide. Safeguard does not check Sigstore or Authenticode signatures on your Python installer and does not stop you running sudo pip. Keep using the official download sources, careful package selection and pip's hash checking alongside it. If you would rather scan projects without sending code anywhere, read how the local runner and offline mode work.

Common mistakes

  • Downloading Python from a search ad or mirror. Use python.org, the Store listing or your distribution, and verify the file.
  • Removing or replacing the system python3 on Linux. It breaks system tooling.
  • Running make install for a source build. Use make altinstall.
  • Using sudo pip install or --break-system-packages on a workstation. Use a venv or pipx.
  • Calling bare pip with several Pythons installed. Use python -m pip or py -m pip.
  • Mixing two Windows install methods for one version. They update separately and fight over PATH.
  • Updating Python but not the virtual environments. Old environments keep old pip and certifi.
  • Staying on an end of life line. 3.10 reached end of life on 1 October 2026.
  • Committing .venv to Git. Commit requirements instead.

FAQ

How do I install Python on Windows 11?

Install the Python install manager from the Microsoft Store or python.org, then run py install default in a new terminal and check with py list. The legacy .exe installer still exists for 3.15 but is deprecated and ends with 3.15.

Is pip installed automatically with Python?

Yes. python.org installers, install manager runtimes and every python -m venv environment include pip. If it is missing, run python -m ensurepip --upgrade (or py -m ensurepip --upgrade).

How do I install pip on Ubuntu?

Ubuntu's guide uses sudo apt install -y python3-pip python3-pip-whl. For project work, install python3-full and use a virtual environment, which has its own pip.

What does "Add python.exe to PATH" do?

It adds the Python and Scripts folders to PATH so python works from any terminal. The unattended equivalent is PrependPath=1, which also adds .PY to PATHEXT and puts this Python ahead of the Store shortcut.

Should I install Python from the Microsoft Store or python.org?

For the install manager, the Python docs say the two are identical. Use the python.org MSI on Windows Server 2019, which lacks MSIX support.

How do I fix "error: externally-managed-environment"?

Create and activate a virtual environment and run pip there, use pipx for command line tools, or install the distribution's python3- package. Avoid --break-system-packages.

How do I verify a Python download is genuine?

Run python -m sigstore verify identity with the .sigstore bundle and the release manager identity and issuer from python.org. On Windows, also confirm a valid PSF Authenticode signature and compare Get-FileHash with the release table.

Which Python version should I install in 2026?

3.15 or 3.14, both in bug fix support as of 23 October 2026. 3.11 to 3.13 get security fixes only, and 3.10 is end of life.

What is the difference between pip and pip3?

They are script names that may belong to different interpreters. Use python3 -m pip, py -m pip or python -m pip in a venv to be sure.

Fix it without waiting for upstream

Installing Python correctly is step one. The packages you then install from PyPI are where most Python vulnerabilities live, and the gap between a fix being released and that fix reaching your requirements files is the part you control.

Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.

1. Autonomous remediation: pull requests, not tickets

When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.

2. Gold Open Source: the safe version in seconds, free

gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.

3. Gold Registry: start from components that are already fixed

registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.

When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.

Your situationWhat to use
A fixed version existsAutonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version
You need to know today whether you are affectedGold Open Source lookup and "Am I affected?" checker, free and without login
You want vulnerable versions to stop shippingThe Gold scan GitHub Action in CI, plus Safeguard policies and gates
Upstream has no fix yet, or will not ship oneA custom Gold request; fork and patch (early access)
You want to start clean on new projectsPull hardened components and images from Gold Registry

One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.

See how Safeguard would help

None of these demos install Python; they show what happens once your projects pull packages. To try the CLI, download it from https://safeguard.sh/download and read the setup guide at https://docs.safeguard.sh/docs/cli .

The first demo is a real CLI session. After install, safeguard opens the interactive terminal, you ask it to fix the lodash CVE in a repo, and it reads the finding and advisory, asks before each command, edits package.json to lodash 4.17.21, runs npm install and npm test with your approval, prints a summary and pushes nothing. The project is npm, but the same flow fits Python: change the pinned PyPI version in requirements, reinstall in the venv and rerun tests, approving each step.

Click through it at your own pace, or open it full screen.

The second demo sets up the Safeguard runner on your own machine, approves it with its device code, and scans from the terminal. On a newly set up Windows or Linux workstation, that gives each Python project a dependency inventory and vulnerability check without moving its code anywhere.

Click through it at your own pace, or open it full screen.

The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. If you already ask an assistant for help with Python setup, this lets it look up real findings for your projects instead of guessing which versions are affected.

Click through it at your own pace, or open it full screen.

Quick check

Why should you build Python from source with make altinstall rather than make install?

The Python docs warn that make install can overwrite or masquerade the python3 binary that your Linux distribution's own tools depend on. make altinstall installs only a versioned binary such as python3.15, so the system Python stays untouched.

You downloaded the Python 3.15 Windows installer. Which identity and issuer should its Sigstore bundle be checked against?

python.org lists hugo@python.org with the issuer https://github.com/login/oauth for the 3.14 and 3.15 lines. Pass both to python -m sigstore verify identity. From 3.14 onward there is no OpenPGP signature to fall back on, so Sigstore plus the PSF Authenticode signature are the checks that apply.

Sources

Last reviewed: 23 October 2026. Python release dates, installer options and distribution packaging change often; check the linked official pages for the latest details.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.