The shell could not find a uvicorn executable. Either uvicorn was never installed into the active interpreter, or it lives in a venv the step did not activate, so its console script is not on PATH.
What this error means
A step that runs uvicorn app.main:app fails with "uvicorn: command not found" and exit code 127, even though python --version works.
python
/home/runner/work/_temp/script.sh: line 1: uvicorn: command not found
Error: Process completed with exit code 127.
Diagnose it: which interpreter and which environment?
Terminal
which -a python python3 pip
python -c "import sys; print(sys.executable); print(sys.version)"
python -c "import sys; [print(p) for p in sys.path]"
pip list 2>/dev/null | head -20
Common causes
uvicorn is not a declared dependency
The install step brought in FastAPI but not uvicorn, so no uvicorn script exists on the runner.
A venv holding uvicorn was not activated
uvicorn is installed inside a virtual environment that the current step did not activate, so the launcher is not on PATH.
How to fix it
Install uvicorn and run it as a module
Add uvicorn to your dependencies and invoke it through the interpreter so PATH is never the issue.
Declare uvicorn[standard] in your requirements or pyproject dependencies.
Call python -m uvicorn so PATH lookup never fails.
Activate the correct venv in every step that launches the server.
Frequently asked questions
What causes FastAPI "uvicorn: command not found" in CI?
There are 2 common causes: uvicorn is not a declared dependency and a venv holding uvicorn was not activated. The install step brought in FastAPI but not uvicorn, so no uvicorn script exists on the runner.
How do I fix FastAPI "uvicorn: command not found" in CI?
There are 2 fixes depending on which cause you have: install uvicorn and run it as a module and activate the venv that holds uvicorn. Work through them in order, since the first is the most common.
What does FastAPI "uvicorn: command not found" in CI actually mean?
A step that runs uvicorn app.main:app fails with "uvicorn: command not found" and exit code 127, even though python --version works.
How do I stop FastAPI "uvicorn: command not found" in CI happening again?
Declare uvicorn[standard] in your requirements or pyproject dependencies. The prevention section lists 3 changes that keep it from recurring.