BugMedic

Python “pip: command not found”: bootstrap it with ensurepip

Use python3 -m pip, bootstrap with ensurepip, or install pip via your OS package manager.

By BugMedic editorial teamLast source review: 2026-09-29Windows, macOS, Linux

First try python3 -m pip --version — the module often exists when the command doesn't. If truly missing, run python3 -m ensurepip --default-pip, or on Debian/Ubuntu install python3-pip with apt. Prefer python3 -m pip over the bare pip command going forward.

Try these fixes in order

01

Try python -m pip first

This works even when the pip executable is not on PATH, and sidesteps python/pip mismatches.

python3 -m pip --version
02

Bootstrap with ensurepip

The standard library can bootstrap pip itself. This is the documented first fallback.

python3 -m ensurepip --default-pip
03

Or install via the OS package manager

On Debian/Ubuntu, pip for system Python comes from the distro package; install it with apt.

sudo apt install python3-pip
04

Last resort: get-pip.py

If ensurepip was stripped too, run the official bootstrap script from bootstrap.pypa.io.

python3 get-pip.py

Interpret what you see

pip worked before a PATH or shell change

What it suggests: The pip module may already exist even when the pip script is missing from PATH; python -m pip bypasses the PATH problem entirely.

Next check: Try python3 -m pip --version first.

Fresh Linux install via apt/dnf

What it suggests: Linux distro Pythons often ship without pip; the ensurepip bootstrap module can install it from the standard library.

Next check: Run python3 -m ensurepip --default-pip.

ensurepip reports no module named ensurepip

What it suggests: If ensurepip is also missing (some distros strip it), the official get-pip.py bootstrap script is the fallback.

Next check: Download get-pip.py from bootstrap.pypa.io and run it with python3.

Why this happens

  • pip was never installed for this Python (common with Linux distro packages and some minimal installs).
  • The pip executable is not on PATH even though the pip module exists.

Still not working?

Do not download random get-pip.py copies from unofficial sites; use the bootstrap.pypa.io URL from the official docs. And never sudo pip install to fix a missing pip.

Official sources

These steps are based on the linked documentation and general diagnostics. BugMedic has not independently tested every product and system configuration. Review commands before running them.

Related Python guides