Quick fix
# One-liner: install python-is-python3 so python points to python3 (official package, no side effects)
sudo apt update && sudo apt install -y python-is-python3 && python --version
What you will run into
On Ubuntu/Debian (incl. WSL), python --version reports Command 'python' not found; you think Python isn't installed, search tutorials, reinstall — but python3 --version clearly works.
The problem isn't that Python is missing: the system simply has no python command.
Old tutorials and Windows habits hardcode python, which fails immediately.
Why this happens
Ubuntu 18.04+ stopped shipping a python command (only python3 is installed) — this is official design: deliberately avoiding python2/python3 confusion so scripts can't grab the wrong interpreter.
But tons of old tutorials, CI configs, and Windows users still write python, making "command not found" one of the most common walls for CN beginners.
- Running
pythondirectly goes through the system PATH lookup; withoutpython-is-python3installed, Ubuntu has no such entry. python3existing ≠pythonexisting; they're independent command names.
Deterministic takeaway: on Ubuntu/WSL, first confirm the interpreter with which python3, then decide.
Change python to python3 in scripts and CI — the correct fix, aligned with the distro design.
Or install python-is-python3 (sudo apt install python-is-python3): it provides a python → python3 symlink for legacy scripts.
Do not rely on aliases — they do not load in non-interactive shells, so CI ignores them.
Fixed diagnostic: no output from command -v python means the entry does not exist, not that it is broken.
Step by step
1. First confirm it's this problem — Required
command -v python; echo "exit=$?"
python3 --version
command -v python empty while python3 --version works → this is the problem (measured consistent).
2. Install python-is-python3 (recommended) — Required
sudo apt update && sudo apt install -y python-is-python3
This is an official Ubuntu package; after install, python is a symlink to python3, affecting no existing environment.
3. If you don't want to install it, change how you call it — Required
- Use
python3in site docs; - Write shebangs as
#!/usr/bin/env python3(most compatible; don't rely onpython); - Or a temporary
alias python=python3in the current shell (only affects that shell).
How to confirm it works
python --version
A normal version output (e.g. Python 3.14.4) means success. Measured: before the fix python --version reported not found (exit=127); python3 --version → Python 3.14.4.
Other environments
| Environment | Notes |
|---|---|
| Ubuntu/Debian 18.04+ | No python command; install python-is-python3 |
| WSL Ubuntu | Same; note this is Linux-side behavior for Windows-habituated python users |
| venv virtual environment | venv ships its own python; nothing to do |
| macOS | Ships python3; python depends on the Xcode CLT version; also recommended to write python3 |
Symptom
python fails on Ubuntu/Debian (incl. WSL):
$ python --version
Command 'python' not found, did you mean:
command 'python3' from deb python3
command 'python' from deb python-is-python3
python3 --versionworks fine.- Scripts/tutorials hardcoding
pythonfail immediately.
Cause
- Ubuntu 18.04+ intentionally stopped shipping the
pythoncommand (python3 only) to avoid python2/python3 confusion. - Old tutorials, scripts and Windows habits still write
python.
Solution
- Temporary: use
python3; oralias python=python3(current shell only). - System-level (recommended):
sudo apt update && sudo apt install -y python-is-python3
python --version
- Write scripts with
python3or shebang#!/usr/bin/env python3. - Inside a venv,
pythonworks (venv provides it); the issue is only the system interpreter.
Verification Evidence
- Local (WSL Ubuntu, 2026-08-29):
command -v python→ empty, exit=1.python --version→python: command not found, exit=127 — matches user error.python3 --version→ Python 3.14.4, exit=0.- python-is-python3 not installed (fix documented, not installed/tested).
Evidence details kept locally (2026-08-29)
Applicable tools (1)
This problem is linked from the tool pages below — reachable from either side.
pythonBundled solutions (combos)
This problem is part of the following verified bundles.
Source & evidence
Source: https://stackoverflow.com/questions/39885520/why-does-ubuntu-show-python-command-not-found
← Coding Agents & Terminal domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk