{"record":{"id":"fda747386a67afc3","repo":"astral-sh/ruff","slug":"failed-to-resolve-uv-executable-error","errorCode":null,"errorMessage":"failed to resolve uv executable: {error}","messagePattern":"failed to resolve uv executable: (.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/ty_project/src/uv/command.rs","lineNumber":118,"sourceCode":"    }\n}\n\n/// The workspace or standalone script for which to request uv metadata.\n#[derive(Debug)]\npub(crate) enum MetadataTarget<'path> {\n    /// The directory from which uv discovers the workspace, not necessarily the workspace root.\n    Workspace(&'path SystemPath),\n    /// A standalone Python script.\n    Script {\n        /// The script file passed to `--script`.\n        path: &'path SystemPath,\n        /// The optional `--python` argument.\n        python: Option<&'path SystemPath>,\n    },\n}\n\npub(crate) fn uv_executable_error(error: WhichError) -> std::io::Error {\n    std::io::Error::new(\n        std::io::ErrorKind::NotFound,\n        format!(\"failed to resolve uv executable: {error}\"),\n    )\n}\n\npub(super) fn unsupported_command_execution() -> std::io::Error {\n    std::io::Error::new(\n        std::io::ErrorKind::Unsupported,\n        \"running commands is not supported by this system\",\n    )\n}\n\n#[cfg(test)]\nmod tests {\n    use ruff_db::system::TestSystem;\n    use ty_static::EnvVars;\n\n    use super::Uv;","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ty_project/src/uv/command.rs#L100-L136","documentation":"ty's project system builds an error when it cannot locate the `uv` executable on the system. `uv_executable_error` wraps a `WhichError` (from the `which` crate) into a `std::io::Error` with kind `NotFound`, meaning commands that need to spawn uv (synchronization, metadata resolution) cannot proceed because no uv binary was found on PATH.","triggerScenarios":"ty attempts to run `uv` (e.g. for environment sync or package metadata) and the `which`-based lookup fails — uv is not installed, not on PATH, or not executable. Raised via `uv_executable_error` in `crates/ty_project/src/uv/command.rs:118`.","commonSituations":"Projects configured to use uv in environments where uv is not installed; CI containers without uv on PATH; PATH differences between the shell and the IDE-spawned ty process; uv installed via a tool manager that ty's environment doesn't inherit.","solutions":["Install uv (e.g. `pip install uv`, `cargo install uv`, or the official installer) or point the project to an environment that does not require uv.","Ensure the uv binary is on the PATH of the process running ty (IDE-spawned servers may need PATH configured in the IDE settings).","Verify with `which uv` / `uv --version` in the same environment ty runs in.","If uv cannot be installed, switch the project configuration to a non-uv interpreter setup."],"exampleFix":"// before: ty project requires uv but it is absent\n// after (shell)\ncurl -LsSf https://astral.sh/uv/install.sh | sh\nexport PATH=\"$HOME/.local/bin:$PATH\"  # ensure ty's process can see it","handlingStrategy":"validation","validationCode":"# shell: verify uv is resolvable in the exact environment ty runs in\ncommand -v uv >/dev/null 2>&1 || { echo 'uv not found on PATH'; exit 1; }\nuv --version","typeGuard":null,"tryCatchPattern":"// Rust caller: match on the io::ErrorKind::NotFound to give actionable guidance\nmatch result {\n  Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n    eprintln!(\"uv is not installed or not on PATH; install uv or disable uv sync\")\n  }\n  other => other?,\n}","preventionTips":["Install uv in every environment that runs ty, including CI images and devcontainers.","Configure the IDE's server environment PATH explicitly (IDE-spawned processes may not inherit your shell PATH).","Prefer a pinned uv installation path referenced in project docs."],"tags":["uv","environment","path","io"],"backgroundTag":"executable-not-found","analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}