tox "py3X: InterpreterNotFound" in CI
tox tried to create a virtualenv for a pyXY environment but could not find a matching interpreter on PATH. The version named in the env factor is simply not installed on the runner.
What this error means
tox reports "py311: InterpreterNotFound: python3.11" (or skips the env) because the runner only provisioned a different Python version.
python
py311: skipped because could not find python interpreter with spec(s): py311
py311: SKIP
py311: InterpreterNotFound: python3.11Common causes
The targeted Python version is not installed
tox env py311 needs python3.11 on PATH; the runner only set up, say, 3.12, so tox cannot find it.
Only one Python was provisioned for a multi-env matrix
A tox config running several pyXY envs needs every interpreter present, but setup-python provisioned just one.
How to fix it
Provision every Python the tox envs need
- List the Python versions referenced by your tox envlist.
- Install each with setup-python (it supports multiple versions).
- Re-run tox so each env finds its interpreter.
.github/workflows/ci.yml
- uses: actions/setup-python@v5
with:
python-version: |
3.10
3.11
3.12Run one tox env per matrix job
Map each matrix Python to a single tox env with -e so only one interpreter is required per job.
.github/workflows/ci.yml
tox -e py${{ matrix.python-version }}How to prevent it
- Provision all interpreters referenced by the tox envlist.
- Or fan out one tox env per CI matrix entry.
- Keep the tox envlist and the setup-python versions in sync.
Related guides
nox "Python interpreter X not found" in CIFix nox "Python interpreter X not found" in CI - a parametrized nox session requests a Python version that is…
tox "ERROR: InterpreterNotFound" in CIFix tox "ERROR: InterpreterNotFound: pythonX.Y" in CI - tox cannot find the Python interpreter an environment…
tox "ERROR: environment failed" in CIFix tox "ERROR: py312: failed" / "InvocationError" in CI - a tox environment's commands or setup returned non…