jdx/mise · error

invalid python.precompiled_arch={arch:?}: this looks like an

Error message

invalid python.precompiled_arch={arch:?}: this looks like an OS value. Use python.precompiled_os={arch:?} instead, and set python.precompiled_arch to an architecture such as "x86_64" or "aarch64".

What it means

Companion validation: python.precompiled_arch must be an architecture, not an OS name. If the value looks like an OS (linux, macos, windows...), mise rejects it and directs you to python.precompiled_os, suggesting arch values like x86_64 or aarch64.

Source

Thrown at src/plugins/core/python.rs:1366

    } else {
        "python-precompiled.gz".into()
    }
}

fn validate_python_precompiled_settings(settings: &Settings) -> Result<()> {
    if let Some(arch) = &settings.python.precompiled_arch
        && let Some((precompiled_arch, precompiled_os)) = split_python_precompiled_triple(arch)
    {
        bail!(
            "invalid python.precompiled_arch={arch:?}: this looks like a target triple. \
             Set python.precompiled_arch={precompiled_arch:?} and \
             python.precompiled_os={precompiled_os:?} instead."
        );
    }
    if let Some(arch) = &settings.python.precompiled_arch
        && looks_like_python_precompiled_os_value(arch)
    {
        bail!(
            "invalid python.precompiled_arch={arch:?}: this looks like an OS value. \
             Use python.precompiled_os={arch:?} instead, and set python.precompiled_arch \
             to an architecture such as \"x86_64\" or \"aarch64\"."
        );
    }
    Ok(())
}

fn split_python_precompiled_triple(value: &str) -> Option<(&str, &str)> {
    ["-unknown-linux", "-apple-darwin", "-pc-windows"]
        .iter()
        .find_map(|os_marker| {
            let index = value.find(os_marker)?;
            (index > 0).then(|| (&value[..index], &value[index + 1..]))
        })
}

fn looks_like_python_precompiled_os_value(value: &str) -> bool {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Move the OS value to python.precompiled_os and set python.precompiled_arch to an architecture like x86_64 or aarch64
  2. Unset both settings to fall back to auto-detection

Example fix

// before
mise settings set python.precompiled_arch linux

// after
mise settings set python.precompiled_arch x86_64
mise settings set python.precompiled_os linux
Defensive patterns

Strategy: validation

Validate before calling

arch=$(mise settings get python.precompiled_arch 2>/dev/null || true)
case "$arch" in linux|macos|windows|darwin) echo "OS value in precompiled_arch; move it to precompiled_os";; esac

Prevention

When it happens

Trigger: Setting `python.precompiled_arch = "linux"` (or macos/windows) and then installing python; validated by validate_python_precompiled_settings during install.

Common situations: Swapping the two settings by mistake; documentation confusion about which of precompiled_arch / precompiled_os takes which value.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/2428c6c1b967d8a2. Report an issue: GitHub.