Skip to content

How to Fix 'pip: command not found' or 'pip version too old'

DodaTech 2 min read

In this tutorial, you'll learn about How to Fix 'pip: command not found' or 'pip version too old. We cover key concepts, practical examples, and best practices.

The Problem

You run pip install <package> and get pip: command not found or WARNING: You are using pip version X; however, version Y is available. pip is either not installed, not in your PATH, or too old to support modern package formats like pyproject.toml. Older pip versions may also fail to install packages that require newer metadata formats.

Quick Fix

1. Install pip if missing

# Ubuntu / Debian
sudo apt-get update && sudo apt-get install python3-pip

# RHEL / CentOS / Fedora
sudo yum install python3-pip
# or
sudo dnf install python3-pip

2. Use the Python module to ensure pip is available

python3 -m pip install --upgrade pip

python3 -m pip always works because Python knows where its own modules are, even if the pip command isn't in PATH.

3. Upgrade pip to the latest version

python3 -m pip install --upgrade pip

After upgrade, verify:

python3 -m pip --version

Expected output:

pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)

4. Add pip to PATH

# Find where pip is
which python3
# pip is usually at ~/.local/bin/pip or /usr/bin/pip3

# Add to PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

5. Install pip for your user only (no sudo)

python3 -m ensurepip --upgrade --user
python3 -m pip install --upgrade pip --user

This installs pip in your home directory without requiring sudo.

6. Install a specific pip version

python3 -m pip install pip==23.3.2

Useful if the latest version is incompatible with your Python version.

7. Fix broken pip installation

# Reinstall pip
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade --force-reinstall pip

Common Causes

Cause Symptom Fix
Python 2 vs Python 3 confusion pip points to Python 2 Use pip3 or python3 -m pip
pip not installed with Python pip: command not found python3 -m ensurepip --upgrade
Outdated pip version WARNING: You are using pip version X python3 -m pip install --upgrade pip
pip not in PATH bash: pip: command not found export PATH="$HOME/.local/bin:$PATH"
Using system Python without pip No module named pip sudo apt-get install python3-pip

Prevention

  • Use python3 -m pip instead of pip to avoid ambiguity with Python 2
  • Upgrade pip regularly: python3 -m pip install --upgrade pip
  • After installing Python, verify: python3 -m pip --version
  • Use python3 -m venv and activate the virtual environment — it includes pip automatically

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro