jdx/mise · error

conflicting pypi and pipx settings in the same file

Error message

conflicting pypi and pipx settings in the same file

What it means

Within a single config file layer, mise forbids defining both the new `pypi.uvx`/`pypi.registry_url` settings and the legacy `pipx.uvx`/`pipx.registry_url` settings with different values. The hierarchy loader checks each layer and bails if the pypi and pipx variants conflict, since it could not determine which value the user intended.

Solutions

  1. Open the config file named in the error and make `pypi.*` and `pipx.*` values identical.
  2. Prefer removing the legacy `pipx.uvx`/`pipx.registry_url` keys and keeping only the `pypi.*` equivalents.
  3. Re-run the command; if the error names multiple files, fix each layer one at a time.

Example fix

# before (mise.toml)
[settings]
pypi.registry_url = "https://pypi.org/simple"
pipx.registry_url = "https://mirror.example.com/simple"

# after
[settings]
pypi.registry_url = "https://pypi.org/simple"
Defensive patterns

Strategy: validation

Validate before calling

# shell: check a config file for conflicting keys before use
if grep -q 'pypi.registry_url' f.toml && grep -q 'pipx.registry_url' f.toml; then
  echo "conflict in $f"; fi

Try / catch

// rust: fall back to a clearer message when the error occurs
match Settings::load_sources_from(...) {
    Err(e) if e.to_string().contains("conflicting pypi") => {
        eprintln!("Fix: remove legacy pipx.* keys from your config");
    }
    r => r?,
}

Prevention

When it happens

Trigger: A single settings/config file sets `pypi.uvx` and `pipx.uvx` (or `pypi.registry_url` and `pipx.registry_url`) to different values, and settings are loaded with SettingsSourcePolicy::Hierarchy.

Common situations: Users migrating from `pipx.*` settings to the newer `pypi.*` settings edit one of the two but leave the other at its old value; copy-pasted global config from another machine; merging config files by hand.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/2178488fea895f69. Report an issue: GitHub.

Appendix: source

Thrown at src/config/settings.rs:1039

            {
                alias_layer.pypi.uvx = env_aliases.pypi.uvx;
                alias_layer.pipx.uvx = env_aliases.pypi.uvx;
            }
            if std::env::var_os("MISE_PYPI_REGISTRY_URL").is_some()
                || std::env::var_os("MISE_PIPX_REGISTRY_URL").is_some()
            {
                alias_layer.pypi.registry_url = env_aliases.pypi.registry_url.clone();
                alias_layer.pipx.registry_url = env_aliases.pypi.registry_url;
            }
            builder = builder.preloaded(alias_layer);
        }
        builder = builder.env();
        if policy.source == SettingsSourcePolicy::Hierarchy {
            for layer in Self::settings_layers_from(root, policy.trust) {
                if matches!((&layer.pypi.uvx, &layer.pipx.uvx), (Some(a), Some(b)) if a != b)
                    || matches!((&layer.pypi.registry_url, &layer.pipx.registry_url), (Some(a), Some(b)) if a != b)
                {
                    bail!("conflicting pypi and pipx settings in the same file");
                }
                builder = builder.preloaded(layer);
            }
            builder = builder.preloaded(DEFAULT_SETTINGS.clone());
        }
        let mut settings = builder.load()?;
        settings.normalize_pypi_aliases()?;
        normalize_storage_dirs(&mut settings)?;
        validate_settings_enum_values(&settings)?;
        settings.validate_lockfile_mode()?;
        Ok(settings)
    }

    /// Load eligible config-file settings layers in precedence order and combine settings whose
    /// semantics are additive across files.
    fn settings_layers_from(
        root: Option<&Path>,
        trust_policy: SettingsTrustPolicy,

View on GitHub (pinned to 533346cc37)