Matched 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
Python or pip command not found
What this failure means
The python or pip command is not available in the CI environment’s PATH.
Symptoms
Faultline looks for one or more of these log fragments:
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.
Why it matters
Python is required for many dependency installation tools (pip, poetry), native module compilation (node-gyp), and test runners (pytest). Missing Python blocks these essential build steps.
Prevention
- Use base images that include Python by default.
- Standardize on
python3andpip3in scripts to avoid ambiguity. - Add a pre‑step that checks for Python before running Python‑dependent commands.
Try it locally
python3 --version
which python3
python3 --version
How Faultline detects it
Use faultline explain python-command-not-found to see the full playbook.
faultline analyze build.log
faultline explain python-command-not-found
Generated from playbooks/bundled/log/build/python-command-not-found.yaml. Do not edit directly.