nox session failed in CI
nox runs each session in its own virtualenv and a command inside a session exited non-zero (or the session's interpreter was missing). nox marks that session failed and exits non-zero, summarizing which sessions passed and failed.
What this error means
nox ends with "Sessions failed: tests-3.12" and a non-zero exit, after a command in the session (pytest, lint) returned an error.
python
nox > Command pytest failed with exit code 1
nox > Session tests-3.12 failed.
Sessions failed: tests-3.12Common causes
A command in the session exited non-zero
The real failure (a failing test, a lint error) happened inside the session; nox just surfaces the non-zero exit.
The session interpreter is unavailable
A @nox.session(python="3.12") cannot run if 3.12 is not installed, failing the session before commands run.
How to fix it
Read the failing command output
- Scroll to the "Command X failed" line and the output above it.
- Fix the underlying failure (the test, lint, or build error).
- Re-run the specific session with
nox -s <session>.
Terminal
nox -s tests-3.12Ensure session interpreters exist
Install the Python versions your sessions target so nox can create their venvs.
.github/workflows/ci.yml
- uses: actions/setup-python@v5
with:
python-version: '3.12'How to prevent it
- Provision all interpreters nox sessions target in CI.
- Run failing sessions individually to isolate the command.
- Keep session dependency lists pinned for reproducibility.
Related guides
tox "ERROR: InterpreterNotFound" in CIFix tox "ERROR: InterpreterNotFound: pythonX.Y" in CI - tox cannot find the Python interpreter an environment…
coverage.py "No source for code" in CIFix coverage.py "NoSource: No source for code" / "CoverageWarning: No source" in CI - coverage recorded a fil…
ruff lint errors / "would reformat" failing CIFix ruff failing CI with lint violations or "would reformat" - ruff found rule violations or formatting diffe…