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
- 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.
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
- 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.
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
- conflicting pypi. and pipx. settings
- backend must be a string or table
- bootstrap service ' ' cannot be both masked and running
- bootstrap service ' ' cannot be both masked and enabled
- collection updates require scalar or array values
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)