{"record":{"id":"0ee0b7a0f0c97946","repo":"astral-sh/uv","slug":"the-default-flag-cannot-be-used-with-multiple","errorCode":null,"errorMessage":"The `--default` flag cannot be used with multiple targets","messagePattern":"The `--default` flag cannot be used with multiple targets","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/python/install.rs","lineNumber":325,"sourceCode":"    concurrency: &Concurrency,\n    preview: Preview,\n    printer: Printer,\n) -> Result<ExitStatus> {\n    let start = std::time::Instant::now();\n\n    // TODO(zanieb): We should consider marking the Python installation as the default when\n    // `--default` is used. It's not clear how this overlaps with a global Python pin, but I'd be\n    // surprised if `uv python find` returned the \"newest\" Python version rather than the one I just\n    // installed with the `--default` flag.\n    if default && !preview.is_enabled(PreviewFeature::PythonInstallDefault) {\n        warn_user!(\n            \"The `--default` option is experimental and may change without warning. Pass `--preview-features {}` to disable this warning\",\n            PreviewFeature::PythonInstallDefault\n        );\n    }\n\n    if default && targets.len() > 1 {\n        anyhow::bail!(\"The `--default` flag cannot be used with multiple targets\");\n    }\n\n    // Read the existing installations, lock the directory for the duration\n    let installations = ManagedPythonInstallations::from_settings(install_dir.clone())?.init()?;\n    let installations_dir = installations.root();\n    let scratch_dir = installations.scratch();\n    let _lock = installations.lock().await?;\n    let existing_installations: Vec<_> = installations\n        .find_all()?\n        .inspect(|installation| trace!(\"Found existing installation {}\", installation.key()))\n        .collect();\n\n    // Resolve the requests\n    let mut is_default_install = false;\n    let mut is_unspecified_upgrade = false;\n    let retry_policy = client_builder.retry_policy();\n    let download_list = ManagedPythonDownloadList::new(\n        &client_builder,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/python/install.rs#L307-L343","documentation":"Error \"The `--default` flag cannot be used with multiple targets\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/python/install.rs:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}