{"record":{"id":"749f8fa5976de83e","repo":"PyO3/pyo3","slug":"the-configured-python-interpreter-version-is","errorCode":null,"errorMessage":"the configured Python interpreter version ({}) is lower than PyO3's minimum supported version ({})","messagePattern":"the configured Python interpreter version \\((.+?)\\) is lower than PyO3's minimum supported version \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pyo3-ffi/build.rs","lineNumber":62,"sourceCode":"};\n\nconst PY_3_15: PythonVersion = PythonVersion {\n    major: 3,\n    minor: 15,\n};\n\nfn ensure_python_version(interpreter_config: &InterpreterConfig) -> Result<()> {\n    // This is an undocumented env var which is only really intended to be used in CI / for testing\n    // and development.\n    if std::env::var(\"UNSAFE_PYO3_SKIP_VERSION_CHECK\").as_deref() == Ok(\"1\") {\n        return Ok(());\n    }\n\n    match interpreter_config.target_abi().implementation() {\n        PythonImplementation::CPython => {\n            let versions = SUPPORTED_VERSIONS_CPYTHON;\n            let interp_version = interpreter_config.target_abi().version();\n            ensure!(\n                interpreter_config.version() >= versions.min,\n                \"the configured Python interpreter version ({}) is lower than PyO3's minimum supported version ({})\",\n                interpreter_config.version(),\n                versions.min,\n            );\n            let v_plus_1 = PythonVersion {\n                major: versions.max.major,\n                minor: versions.max.minor + 1,\n            };\n            if interp_version == v_plus_1 {\n                warn!(\n                    \"Using experimental support for the Python {}.{} ABI. \\\n                     Build artifacts may not be compatible with the final release of CPython, \\\n                     so do not distribute them.\",\n                    v_plus_1.major, v_plus_1.minor,\n                );\n            } else if interp_version > v_plus_1 {\n                let mut error = MaximumVersionExceeded::new(interpreter_config, versions.max);","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/PyO3/pyo3/blob/ac9b6899d348be4d54614d060dea53a645a12e36/pyo3-ffi/build.rs#L44-L80","documentation":"pyo3-ffi's build script refuses to compile when the detected CPython interpreter version is older than the minimum supported by this PyO3 release. This is a compile-time guard: PyO3's FFI bindings rely on APIs absent in older CPython.","triggerScenarios":"Building a crate that depends on pyo3/pyo3-ffi against a CPython interpreter (via PYO3_PYTHON, pyenv, system python) whose major.minor version is below SUPPORTED_VERSIONS_CPYTHON.min for the crate's PyO3 version.","commonSituations":"Old system Python (e.g. 3.6/3.7) picked up automatically; distro EOL Python; CI images with outdated Python; upgrading pyo3 in Cargo.toml while the interpreter stays old.","solutions":["Install and select a newer CPython (e.g. 3.11+) and rebuild","Point the build at the right interpreter: export PYO3_PYTHON=/path/to/python3.12","Check the resolved version with python --version and rustc-linked pyo3-build-config output","If the old interpreter is intentional, downgrade pyo3 to a release that supports it","In CI, cache/preinstall the required Python version"],"exampleFix":"// before (Cargo.toml)\npyo3 = \"0.22\"   # with python3.7 on PATH\n// after: install python3.11 and run\nPYO3_PYTHON=$(which python3.11) cargo build","handlingStrategy":"validation","validationCode":"import sys\nMIN = (3, 7)  # check your pyo3 version's SUPPORTED_VERSIONS_CPYTHON\nv = sys.version_info[:2]\nassert v >= MIN, f\"CPython {v} too old for this pyo3; need >= {MIN}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check pyo3's release notes for its supported CPython range before upgrading","Pin the Python version in CI (actions/setup-python or pyenv) to match pyo3's minimum","Set PYO3_PYTHON explicitly rather than relying on PATH resolution","Add a pre-build script that asserts the interpreter version"],"tags":["rust","python","version-compatibility","build"],"backgroundTag":"unsupported-python-version","analyzedSha":"ac9b6899d348be4d54614d060dea53a645a12e36","analyzedAt":"2026-09-05T09:20:35.319Z","contentChangedAt":"2026-09-05T09:20:35.319Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}