Skip to content

How to Fix 'pip: command not found' Error

DodaTech 1 min read

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

The Problem

You type pip install flask and get:

pip: command not found

Quick Fix

1. Use the pip module directly

python3 -m pip install flask

This always works if Python 3 is installed, even without the pip command.

2. Install pip explicitly

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

# macOS (Homebrew)
brew install python3  # pip comes with it

# Verify
pip3 --version

3. Add pip to PATH

If pip is installed but not in your PATH:

# Find pip
which pip3 || locate bin/pip3

# Add to PATH
export PATH="$HOME/.local/bin:$PATH"

Add the export line to ~/.bashrc or ~/.zshrc.

4. Upgrade pip (if installed but old)

python3 -m pip install --upgrade pip

Which Command to Use?

Command Works when...
pip install pip is in PATH (may point to Python 2)
pip3 install pip3 is installed for Python 3
python3 -m pip install Always works if Python 3 is installed

The python3 -m pip form is the most reliable. Use it as your default.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro