Python or pip command not found
April 30, 2026 · View on GitHub
Playbook ID: python-command-not-found
Category: build
Severity: medium
Tags: python, pip, executable, missing, environment
What this failure means
The python or pip command is not available in the CI environment's PATH.
Common log signals
python: command not found
python3: command not found
pip: command not found
pip3: command not found
bash: python: command not found
bash: pip: command not found
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python3': No such file or directory
Diagnosis
The CI job tried to run python, python3, pip, or pip3 but the command was not found. This usually happens when:
- The base image does not include Python (e.g.,
node:alpine,debian:slimwithout python3). - Python is installed but not in the default PATH.
- The wrong Python version is referenced (e.g.,
pythonvspython3). - A virtual environment is activated but the interpreter is missing.
This is distinct from a generic missing executable because Python is a fundamental runtime for many build and test workflows.
Fix steps
-
Install Python in the CI environment:
Ubuntu/Debian:
apt-get update && apt-get install -y python3 python3-pipAlpine:
apk add --no-cache python3 py3-pipCentOS/RHEL:
yum install -y python3 python3-pip -
Check the available Python executable and adjust the command:
which python3 python3 --version -
Use
python3instead ofpythonif the base image only providespython3. -
In GitHub Actions, use the
actions/setup-pythonaction to ensure a specific Python version:- uses: actions/setup-python@v5 with: python-version: '3.12' -
If using a Docker image, switch to an image that includes Python, such as
python:3.12-slimornode:20(includes Python for node-gyp). -
For pip, ensure it is installed with Python or install it separately:
python3 -m ensurepip --upgrade
Validation
python3 --versionprints a version without "command not found".pip3 --versionorpython3 -m pip --versionshows pip is available.- Re‑run the failing step and confirm Python/pip commands succeed.
Likely files to inspect
.github/workflows/*.yml.gitlab-ci.ymlDockerfilerequirements.txtpyproject.toml
Run Faultline
faultline analyze build.log
faultline explain python-command-not-found
faultline workflow build.log --json --mode agent
Search phrases this page answers
- Python or pip command not found
- Build: python or pip command not found
- /usr/bin/env: 'python3': No such file or directory
- GitHub Actions python or pip command not found
- faultline explain python-command-not-found
- Python python or pip command not found
Generated from playbooks/bundled/log/build/python-command-not-found.yaml. Do not edit directly — run make docs-generate.