{"record":{"id":"faf8d5f0b1ed8576","repo":"astral-sh/uv","slug":"the-interpreter-at-is-externally-managed-and-i-faf8d5","errorCode":null,"errorMessage":"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.","messagePattern":"The interpreter at (.+?) is externally managed, and indicates the following:\n\n(.+?)\n\nConsider creating a virtual environment with `uv venv`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/pip/uninstall.rs","lineNumber":82,"sourceCode":"        );\n        environment.with_target(target)?\n    } else if let Some(prefix) = prefix {\n        debug!(\n            \"Using `--prefix` directory at {}\",\n            prefix.root().user_display()\n        );\n        environment.with_prefix(prefix)?\n    } else {\n        environment\n    };\n\n    // If the environment is externally managed, abort.\n    if let Some(externally_managed) = environment.interpreter().is_externally_managed() {\n        if break_system_packages {\n            debug!(\"Ignoring externally managed environment due to `--break-system-packages`\");\n        } else {\n            return if let Some(error) = externally_managed.into_error() {\n                Err(anyhow::anyhow!(\n                    \"The interpreter at {} is externally managed, and indicates the following:\\n\\n{}\\n\\nConsider creating a virtual environment with `uv venv`.\",\n                    environment.root().user_display().cyan(),\n                    textwrap::indent(&error, \"  \").green(),\n                ))\n            } else {\n                Err(anyhow::anyhow!(\n                    \"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.\",\n                    environment.root().user_display().cyan()\n                ))\n            };\n        }\n    }\n\n    let _lock = environment\n        .lock()\n        .await\n        .inspect_err(|err| {\n            warn!(\"Failed to acquire environment lock: {err}\");","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/pip/uninstall.rs#L64-L100","documentation":"Error \"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/pip/uninstall.rs:82 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"}