Installing & Upgrading pip

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the Python Reference bibliography.

Before pip can install anything it has to be installed itself, and it has to be the right pip for the Python you mean. This page was written against pip 26.2.2 (2026-10-20), which supports CPython 3.10 to 3.15 and the latest PyPy3 on Windows, Linux and macOS. Every command ran on CPython 3.14.6 on 2026-10-22; that interpreter’s ensurepip bundles pip 26.1.2, which makes the upgrade step visible. Paths below the scratch directory are shortened to ….

Check what you have

python -m pip --version
pip 26.1.2 from …/v1/lib/python3.14/site-packages/pip (python 3.14)

The output names the pip version, where it is installed and which Python it runs with. On Windows use the launcher, py -m pip --version. If the command fails with No module named pip, use one of the methods below.

The supported methods

Method What it does Use it when

ensurepip

Installs the pip wheel that ships inside the standard library, offline. python -m venv uses it for every new venv.

Almost always: it is already there.

get-pip.py

A bootstrap script that downloads and installs the latest pip.

The Python has no ensurepip (some distributions strip it).

pip.pyz

pip as a standalone zip application, run by any supported Python, without installing it. Experimental.

Managing an environment that must not contain pip; one-off use.

Redistributor copies

apt install python3-pip, Homebrew’s Python, conda, …

You use that distribution’s Python and want its packaging.

ensurepip

python3.14 -m venv --without-pip v1
v1/bin/python -m ensurepip --upgrade
Processing /tmp/tmp928f6eqj/pip-26.1.2-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-26.1.2

ensurepip never downloads anything: the version you get is the one bundled with that Python release, which is usually a few months older than the newest pip. --upgrade only upgrades to that bundled version if an older one is installed.

Source: pip: ensurepip.

get-pip.py

python3.14 -m venv --without-pip v2
curl -sSO https://bootstrap.pypa.io/get-pip.py
v2/bin/python get-pip.py
…
  Using cached pip-26.2.2-py3-none-any.whl.metadata (4.6 kB)
Using cached pip-26.2.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Successfully installed pip-26.2.2

The script embeds a copy of pip that it uses to download and install the current release. It accepts most pip install options, for example python get-pip.py "pip==26.2.2" to pin a version. Download it from the official URL only; it runs with your permissions.

Source: pip: get-pip.py.

The zip application

curl -sSO https://bootstrap.pypa.io/pip/pip.pyz
python3.14 -m venv --without-pip v3
v3/bin/python pip.pyz --version
v3/bin/python pip.pyz install tomli-w
ls v3/lib/python3.14/site-packages
pip 26.2.2 from …/pip.pyz/pip (python 3.14)
…
Successfully installed tomli-w-1.2.0
tomli_w
tomli_w-1.2.0.dist-info

The environment ends up with tomli-w and no pip of its own. Versioned files are published as pip-X.Y.Z.pyz. The pip documentation calls the zip application experimental: it is tested, but "for now the zip application should not be used in production environments". For managing a pip-less environment from an installed pip, pip --python <env> is the supported alternative (see Environments & Externally Managed Pythons).

Distribution and redistributor copies

Linux distributions, Homebrew and other redistributors ship their own pip, which they "may have modified … to change its behaviour". The PEP 668 marker is the best known example: those Pythons refuse pip install outside a venv. If such a pip behaves differently from these pages, ask the redistributor first. In a venv created from such a Python you get a normal, unmodified pip from ensurepip.

Upgrading pip

Upgrade pip inside each environment, with that environment’s Python:

v1/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in ./v1/lib/python3.14/site-packages (26.1.2)
Collecting pip
  Using cached pip-26.2.2-py3-none-any.whl.metadata (4.6 kB)
Using cached pip-26.2.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 26.1.2
    Uninstalling pip-26.1.2:
      Successfully uninstalled pip-26.1.2
Successfully installed pip-26.2.2
py -m pip install --upgrade pip

pip’s support policy makes upgrading important: only the latest pip release is supported, so a bug report against an older one is answered with "upgrade first". pip releases every quarter; see pip: Versions & Release History. Do not upgrade the pip of a distribution’s system Python this way; it is the distribution’s to manage.

Why python -m pip and not pip

The bare pip command is a small launcher script generated for one Python. Which one you get depends on PATH, shell aliases, the order of bin directories and whether a venv is active, so pip install x and python -c "import x" can easily talk to different interpreters. python -m pip always runs the pip that belongs to that python, and python -m pip --version tells you exactly which one that is. On Windows, pip install --upgrade pip cannot even replace the running pip.exe; py -m pip can. Every example in this section therefore uses python -m pip.

The version self-check

When pip runs, it checks PyPI (at most once a week) for a newer pip and prints a notice:

[notice] A new release of pip is available: 26.1.2 -> 26.2.2
[notice] To update, run: …/.venv/bin/python -m pip install --upgrade pip

--disable-pip-version-check (PIP_DISABLE_PIP_VERSION_CHECK=1) turns it off, which is useful in CI logs and container builds. It is implied by --no-index, and since pip 25.0 pip skips the check by itself in an externally managed environment, where upgrading pip is not the user’s job.

Poetry

Poetry does not use the pip in your project environment to install packages; it has its own installer. It still creates venvs with pip in them (for your own use), and the Poetry equivalent of "install the tool" is covered on Poetry: Installation & Self-Management.