Skip to content
pip: command not found

pip: command not found

DodaTech 2 min read

If you see pip: command not found, it means the pip executable isn’t installed or isn’t on your system PATH. This is common on fresh Python installations or when using a minimal base image.

What It Means

The shell cannot find the pip command in any directory listed in your PATH environment variable. This usually means pip is not installed, or it’s installed under a different name (e.g. pip3).

Why It Happens

  • Python was installed without pip (some Linux distros split them)
  • You’re using a virtual environment that hasn’t been activated
  • The pip executable uses a different name on your system
  • PATH doesn’t include the directory where pip is installed

How to Fix It

Option 1: Use python -m pip directly

If Python itself is installed, pip may be available as a module even if the standalone command is missing:

  1. Try running pip as a Python module instead:
python -m pip install requests
  1. On some systems you might need python3:
python3 -m pip install requests

Option 2: Install pip with ensurepip

Python includes the ensurepip module to bootstrap pip:

  1. Run ensurepip:
python -m ensurepip --upgrade
  1. Verify installation:
python -m pip --version

Option 3: Install via system package manager

On Debian/Ubuntu:

sudo apt update
sudo apt install python3-pip

On Fedora/RHEL:

sudo dnf install python3-pip

On macOS with Homebrew:

brew install python

Option 4: Add pip to PATH manually

If pip is installed but not in PATH, locate it and add it:

find / -name pip 2>/dev/null
export PATH="$PATH:/path/to/pip-directory"

Add the export line to your ~/.bashrc or ~/.zshrc to make it permanent.

Why does 'pip' not work but 'pip3' does?
On some Linux systems the pip package is separate from pip3. Use pip3 as your command, or install python3-pip which provides both. You can also create an alias: alias pip=pip3.
How do I check if pip is installed?
Run pip --version or python -m pip --version. If either returns a version number, pip is available. You can also check with which pip or command -v pip.
Do I need sudo to install pip?
On system Python installations you usually need sudo apt install python3-pip. However, prefer using a virtual environment (python -m venv venv) where you don’t need sudo. In a venv, pip is available immediately after activation.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro