How to Fix 'pip: command not found' on Mac, Ubuntu & Windows
Error Message
zsh: command not found: pip
bash: pip: command not found
Quick Fix
python3 -m pip install <package>
Why Does This Happen?
Modern systems often install Python without creating a standalone pip alias in PATH, or Python was installed without the pip package.
Step-by-Step Solution
1
Solution 1: Use python3 -m pip (works everywhere)
Call pip through the Python binary directly:
Terminal / Code
python3 -m pip install requests
python3 -m pip --version
This guarantees the package installs into the exact Python you are running.
2
Solution 2: Install pip on Ubuntu / Debian
Terminal / Code
sudo apt update && sudo apt install python3-pip -y
pip3 --version
Now pip3 install <package> will work.
3
Solution 3: Bootstrap pip on macOS
Terminal / Code
python3 -m ensurepip --upgrade
# Or with Homebrew:
brew install python
Homebrew automatically adds pip3 to your PATH.
4
Best Practice: Use a Virtual Environment
Avoid polluting your global Python installation:
Terminal / Code
python3 -m venv venv
source venv/bin/activate
pip install flask django requests
Inside a venv, pip always works without sudo or extra flags.
Common Mistakes to Avoid
Running sudo pip install — this can break system packages managed by your OS.
Mixing Python 2 pip and Python 3 pip3 commands on the same system.
Frequently Asked Questions
Why does pip say 'already satisfied' but my script still fails?
Your pip installed into a different Python than the one running your script. Always use python3 -m pip to align them.
Learn to Write Code That Doesn't Break
DoxaTech Hub's 10-month programme teaches you Git internals, Linux systems, C, Python, SQL, Docker, and React from first principles — so you spend less time fixing errors and more time shipping.
Start Learning →