PyO3/pyo3 · error

RustPython only supports targeting abi3t, it does not allow

Error message

RustPython only supports targeting abi3t, it does not allow targeting other Python ABIs. Currently targeting '{kind}'

What it means

Validation error in PythonAbiBuilder::finalize: the implementation is RustPython, which only supports the abi3t (tiered stable) ABI, but the configured ABI kind resolves to something else (e.g. abi3 or a version-specific ABI). RustPython cannot be targeted with those ABI selections, so finalization is rejected.

Source

Thrown at pyo3-build-config/src/impl_.rs:968

            ..self
        }
    }

    pub fn free_threaded(self) -> PythonAbiBuilder {
        PythonAbiBuilder {
            kind: Some(PythonAbiKind::VersionSpecific(GilUsed::FreeThreaded)),
            ..self
        }
    }

    pub fn finalize(self) -> Result<PythonAbi> {
        // default to GIL-enabled version-specific ABI
        let kind = self.kind.unwrap_or(match self.implementation {
            PythonImplementation::RustPython => PythonAbiKind::Stable(StableAbi::Abi3t),
            _ => PythonAbiKind::VersionSpecific(GilUsed::GilEnabled),
        });
        if matches!(self.implementation, PythonImplementation::RustPython) {
            ensure!(matches!(kind, PythonAbiKind::Stable(StableAbi::Abi3t)),
                    "RustPython only supports targeting abi3t, it does not allow targeting other Python ABIs. Currently targeting '{kind}'")
        }
        if matches!(kind, PythonAbiKind::VersionSpecific(GilUsed::FreeThreaded))
            && self.version
                < (PythonVersion {
                    major: 3,
                    minor: 13,
                })
        {
            bail!(
                "Cannot target free-threaded builds for Python versions before 3.13, tried to build for {}", self.version
            )
        }
        Ok(PythonAbi {
            implementation: self.implementation,
            kind,
            version: self.version,
        })

View on GitHub (pinned to ac9b6899d3)

Solutions

  1. Use the abi3-t feature (StableAbi::Abi3t) when targeting RustPython
  2. Remove PYO3_CROSS_PYTHON_ABI settings or feature selections that force a non-abi3t kind
  3. Switch the target implementation to CPython if a different ABI is required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pyo3-build-config/src/impl_.rs:968 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of PyO3/pyo3@ac9b6899d3 (2026-09-05). Data as JSON: /api/errors/2f52900ad6b7444d. Report an issue: GitHub.