Skip to content
Latchkey

pip "WARNING: The scripts ... are installed in '...' which is not on PATH"

pip installed a package’s console scripts into a bin directory that is not on PATH. The install succeeds, but the command it provides "is not found" in a later step.

What this error means

pip prints a yellow warning that scripts were installed in a directory not on PATH (often ~/.local/bin). A subsequent step then fails with "command not found" when calling that tool by name.

pip output
WARNING: The scripts pytest and py.test are installed in
'/home/runner/.local/bin' which is not on PATH.
Consider adding this directory to PATH ...
# later step:
pytest: command not found

Common causes

User install targets ~/.local/bin

A --user install (or an implicit one - see "Defaulting to user installation") puts entry-point scripts under ~/.local/bin, which minimal images do not add to PATH.

A venv bin not exported between steps

Scripts live in the venv’s bin, but a later CI step in a fresh shell never put that bin on PATH, so the command resolves nowhere.

How to fix it

Add the script directory to PATH

On GitHub Actions, append the directory to $GITHUB_PATH so every later step sees it.

.github/workflows/ci.yml
- run: |
    pip install --user pytest
    echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: pytest

Or invoke via the interpreter

Calling the tool as a module avoids PATH entirely and always targets the right interpreter.

Terminal
python -m pytest

How to prevent it

  • Install into a venv and put its bin on the job PATH once.
  • Prefer python -m <tool> over the bare console script in CI.
  • Avoid --user installs unless you also export ~/.local/bin.

Related guides

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