{"record":{"id":"2178488fea895f69","repo":"jdx/mise","slug":"conflicting-pypi-and-pipx-settings-in-the-same-file","errorCode":null,"errorMessage":"conflicting pypi and pipx settings in the same file","messagePattern":"conflicting pypi and pipx settings in the same file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/settings.rs","lineNumber":1039,"sourceCode":"            {\n                alias_layer.pypi.uvx = env_aliases.pypi.uvx;\n                alias_layer.pipx.uvx = env_aliases.pypi.uvx;\n            }\n            if std::env::var_os(\"MISE_PYPI_REGISTRY_URL\").is_some()\n                || std::env::var_os(\"MISE_PIPX_REGISTRY_URL\").is_some()\n            {\n                alias_layer.pypi.registry_url = env_aliases.pypi.registry_url.clone();\n                alias_layer.pipx.registry_url = env_aliases.pypi.registry_url;\n            }\n            builder = builder.preloaded(alias_layer);\n        }\n        builder = builder.env();\n        if policy.source == SettingsSourcePolicy::Hierarchy {\n            for layer in Self::settings_layers_from(root, policy.trust) {\n                if matches!((&layer.pypi.uvx, &layer.pipx.uvx), (Some(a), Some(b)) if a != b)\n                    || matches!((&layer.pypi.registry_url, &layer.pipx.registry_url), (Some(a), Some(b)) if a != b)\n                {\n                    bail!(\"conflicting pypi and pipx settings in the same file\");\n                }\n                builder = builder.preloaded(layer);\n            }\n            builder = builder.preloaded(DEFAULT_SETTINGS.clone());\n        }\n        let mut settings = builder.load()?;\n        settings.normalize_pypi_aliases()?;\n        normalize_storage_dirs(&mut settings)?;\n        validate_settings_enum_values(&settings)?;\n        settings.validate_lockfile_mode()?;\n        Ok(settings)\n    }\n\n    /// Load eligible config-file settings layers in precedence order and combine settings whose\n    /// semantics are additive across files.\n    fn settings_layers_from(\n        root: Option<&Path>,\n        trust_policy: SettingsTrustPolicy,","sourceCodeStart":1021,"sourceCodeEnd":1057,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/config/settings.rs#L1021-L1057","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the config file named in the error and make `pypi.*` and `pipx.*` values identical.","Prefer removing the legacy `pipx.uvx`/`pipx.registry_url` keys and keeping only the `pypi.*` equivalents.","Re-run the command; if the error names multiple files, fix each layer one at a time."],"exampleFix":"# before (mise.toml)\n[settings]\npypi.registry_url = \"https://pypi.org/simple\"\npipx.registry_url = \"https://mirror.example.com/simple\"\n\n# after\n[settings]\npypi.registry_url = \"https://pypi.org/simple\"","handlingStrategy":"validation","validationCode":"# shell: check a config file for conflicting keys before use\nif grep -q 'pypi.registry_url' f.toml && grep -q 'pipx.registry_url' f.toml; then\n  echo \"conflict in $f\"; fi","typeGuard":null,"tryCatchPattern":"// rust: fall back to a clearer message when the error occurs\nmatch Settings::load_sources_from(...) {\n    Err(e) if e.to_string().contains(\"conflicting pypi\") => {\n        eprintln!(\"Fix: remove legacy pipx.* keys from your config\");\n    }\n    r => r?,\n}","preventionTips":["After renaming pipx.* settings to pypi.*, delete the old keys — don't keep both.","Keep a single source of truth for PyPI settings (global config), not per-project copies.","Grep your mise configs for `pipx.` when upgrading mise versions."],"tags":["config","settings","conflict","toml"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}