What This Error Means
Your shell can't find a pip executable on PATH (or you're using an environment where pip is intentionally not installed).
How to Fix It
- Prefer running pip through the interpreter you intend to use:
python3 -m pip install <package>. - If pip is missing entirely, install it using your OS package manager (for example
apt install python3-pip,dnf install python3-pip,brew install python). - If you're using a virtual environment, recreate it to ensure pip is present:
python3 -m venv .venvthen. .venv/bin/activate. - After fixing, upgrade pip inside that same environment:
python3 -m pip install --upgrade pip.
Why It Happens
- pip is not installed for the Python you are using.
- You installed pip in a different Python environment than the one on your PATH (multiple Pythons / multiple envs).
- Your PATH does not include the environment's
bin/directory (or the virtual environment is not activated).
How to Verify
- Run
python3 -m pip --versionand confirm it prints a version and a Python path you expect. - Re-run your original
pip install ...usingpython3 -m pip ....
Manual pip discovery checks
- Check whether pip is on PATH:
command -v pip(orwhich pip). - Check whether
pip3exists:command -v pip3. - Ask Python itself for pip:
python3 -m pip --version(preferred overpip ...). - If this is inside a virtualenv, ensure it is activated:
echo $VIRTUAL_ENVandpython -c 'import sys; print(sys.executable)'.
Common CLI Output
bash: pip: command not foundzsh: command not found: pip How shells find executables
- When you type
pip, your shell searches each directory in thePATHenvironment variable for an executable namedpip. - If pip is not installed (or installed in a different Python environment), the shell prints
command not foundbefore Python is ever started.
Prevention Tips
- Use
python -m pipinstead ofpipto avoid PATH ambiguity. - Use virtual environments per project and activate them before installing dependencies.
- Avoid mixing system Python and custom-installed Python on the same machine without clear PATH management.
Where This Can Be Triggered
Not thrown by pip itself
This message is emitted by your shell / OS launcher (or by the Python interpreter) before pip runs, so there is no pip source file/line to link to.