jdx/mise · error

invalid python.precompiled_arch=

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

python.precompiled_arch must hold an architecture name; when it is set to something that looks like an OS value (e.g. "linux", "macos"), looks_like_python_precompiled_os_value detects the mistake and mise bails with a message telling you to move the value to python.precompiled_os. This guards against swapped settings that would otherwise never match a precompiled distribution.

Solutions

  1. Move the value: set python.precompiled_os = "linux" and python.precompiled_arch = "x86_64" (or "aarch64") as the error instructs
  2. Remove the mistaken setting if no precompiled override was intended

Example fix

// before
[python]
precompiled_arch = "linux"
// after
[python]
precompiled_arch = "x86_64"
precompiled_os = "linux"
Defensive patterns

Strategy: validation

Validate before calling

const OS_VALUES = new Set(["linux","macos","darwin","windows","freebsd"]);
const arch = settings.python?.precompiled_arch;
if (arch && OS_VALUES.has(arch.toLowerCase())) {
  throw new Error(`'${arch}' is an OS; use python.precompiled_os='${arch}' and set precompiled_arch to e.g. x86_64`);
}

Type guard

const looksLikeArch = (v) => /^(x86_64|aarch64|arm64|i686|ppc64le|s390x)$/i.test(v);
// usage: if (!looksLikeArch(arch)) reject(...);

Prevention

When it happens

Trigger: Setting `python.precompiled_arch = "linux"` (or "windows", "macos", etc.) and running `mise install python@...`; also hit by the unit tests of validate_python_precompiled_settings.

Common situations: Swapping the two settings by accident: OS string pasted into the arch field; docs misread; autocomplete picking the wrong key.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/2428c6c1b967d8a2. Report an issue: GitHub.

Appendix: source

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

    } 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 533346cc37)