astral-sh/uv · error · anyhow::Error

The {given} Python version `{}`{resolved} is incompatible wi

Error message

The {given} Python version `{}`{resolved} is incompatible with the {} `requires-python` value of `{}`.

What it means

Error "The {given} Python version `{}`{resolved} is incompatible with the {} `requires-python` value of `{}`." thrown in astral-sh/uv.

Source

Thrown at crates/uv/src/commands/python/pin.rs:367

        }
    };

    let Some(requires_python) = requires_python else {
        return Ok(());
    };

    if requires_python.contains(pin.version) {
        return Ok(());
    }

    let given = if pin.existing { "pinned" } else { "requested" };
    let resolved = if pin.resolved {
        format!(" resolves to `{}` which ", pin.version)
    } else {
        String::new()
    };

    Err(anyhow::anyhow!(
        "The {given} Python version `{}`{resolved} is incompatible with the {} `requires-python` value of `{}`.",
        pin.request.to_canonical_string(),
        project_type,
        requires_python
    ))
}

View on GitHub (pinned to f1a42680ff)

When it happens

Trigger: Thrown at crates/uv/src/commands/python/pin.rs:367 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16). Data as JSON: /api/errors/4ad862ad99eee81f. Report an issue: GitHub.