Skip to content
Latchkey

pip "command not found" on the runner in CI

The shell could not find a pip executable on PATH. The interpreter may not have a standalone pip script, or the venv that holds it was never activated.

What this error means

A step calling pip install ... fails with "pip: command not found" even though python --version works.

python
/home/runner/work/_temp/script.sh: line 1: pip: command not found
Error: Process completed with exit code 127.

Common causes

No standalone pip launcher on PATH

Some images expose only pip3, or pip exists only as a module under a specific Python, with no pip on PATH.

A venv that was never activated

pip lives inside a virtual environment that the current step did not activate, so the shell cannot find it.

How to fix it

Invoke pip through the interpreter

Call pip as a module so you always use the pip belonging to the exact Python you mean.

Terminal
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Ensure pip is installed and on PATH

  1. Confirm pip exists with python -m ensurepip --upgrade.
  2. Activate the venv that holds pip if you are using one.
  3. Prefer python -m pip over bare pip in every step.
Terminal
python -m ensurepip --upgrade

How to prevent it

  • Always call python -m pip so PATH lookup is never an issue.
  • Activate the right venv in each step that needs pip.
  • Use setup-python, which provisions pip alongside the interpreter.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →