Skip to content
Latchkey

nox "Python interpreter X not found" in CI

nox tried to create a virtualenv for a session pinned to a specific Python (@nox.session(python="3.11")), but no interpreter with that version is on PATH, so the session cannot run.

What this error means

nox fails or marks the session failed with "Python interpreter 3.11 not found" because the runner only has a different version installed.

python
nox > Python interpreter 3.11 not found.
nox > Run nox using a Python interpreter that has 3.11, or set --no-error-on-missing-interpreters
nox > Session tests-3.11 failed.

Common causes

The session Python is not installed

A session pinned to a version needs that interpreter on PATH; the runner provisioned a different one.

A multi-version session list with one interpreter present

Parametrized sessions across several Pythons require all of them installed; only one was set up.

How to fix it

Install each Python the sessions request

  1. Enumerate the versions named in your nox.session(python=...) decorators.
  2. Provision them all with setup-python.
  3. Re-run nox.
.github/workflows/ci.yml
- uses: actions/setup-python@v5
  with:
    python-version: |
      3.10
      3.11
      3.12

Run one session per matrix job

Select a single session matching the matrix Python so only one interpreter is needed per job.

.github/workflows/ci.yml
nox --session "tests-${{ matrix.python-version }}"

How to prevent it

  • Provision every interpreter your nox sessions request.
  • Or shard one session per CI matrix entry.
  • Keep session Python pins aligned with the provisioned versions.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →