{"record":{"id":"f49df8b176ec24b0","repo":"astral-sh/uv","slug":"the-executable-directory-is-not-in-path-but-th-f49df8","errorCode":null,"errorMessage":"The executable directory {} is not in PATH, but the necessary command to update {shell} could not be determined","messagePattern":"The executable directory (.+?) is not in PATH, but the necessary command to update (.+?) could not be determined","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/update_shell.rs","lineNumber":75,"sourceCode":"    let Some(shell) = Shell::from_env() else {\n        return Err(anyhow::anyhow!(\n            \"The executable directory {} is not in PATH, but the current shell could not be determined\",\n            executable_directory.simplified_display().cyan()\n        ));\n    };\n\n    // Look up the configuration files (e.g., `.bashrc`, `.zshrc`) for the shell.\n    let files = shell.configuration_files();\n    if files.is_empty() {\n        return Err(anyhow::anyhow!(\n            \"The executable directory {} is not in PATH, but updating {shell} is currently unsupported\",\n            executable_directory.simplified_display().cyan()\n        ));\n    }\n\n    // Prepare the command (e.g., `export PATH=\"$HOME/.cargo/bin:$PATH\"`).\n    let Some(command) = shell.prepend_path(executable_directory) else {\n        return Err(anyhow::anyhow!(\n            \"The executable directory {} is not in PATH, but the necessary command to update {shell} could not be determined\",\n            executable_directory.simplified_display().cyan()\n        ));\n    };\n\n    // Update each file, as necessary.\n    let mut updated = false;\n    for file in files {\n        // Search for the command in the file, to avoid redundant updates.\n        match fs_err::tokio::read_to_string(&file).await {\n            Ok(contents) => {\n                if contents\n                    .lines()\n                    .map(str::trim)\n                    .filter(|line| !line.starts_with('#'))\n                    .any(|line| line.contains(&command))\n                {\n                    debug!(","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/update_shell.rs#L57-L93","documentation":"Error \"The executable directory {} is not in PATH, but the necessary command to update {shell} could not be determined\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/update_shell.rs:75 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"}