{"record":{"id":"1c4dd2dc3de835fb","repo":"astral-sh/ruff","slug":"notfound","errorCode":"NotFound","errorMessage":"failed to resolve uv executable: {error}","messagePattern":"failed to resolve uv executable: (.+?)","errorType":"error_code","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/ty_project/src/uv/metadata.rs","lineNumber":95,"sourceCode":"            python_version,\n        })\n    }\n\n    pub(crate) fn root(&self) -> &SystemPath {\n        &self.root\n    }\n\n    pub(crate) fn environment(&self) -> Option<&SystemPath> {\n        self.environment.as_deref()\n    }\n\n    pub(crate) fn python_version(&self) -> Option<&RangedValue<SupportedPythonVersion>> {\n        self.python_version.as_ref()\n    }\n}\n\nfn 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\nfn resolve_python_version(\n    version: &Version,\n) -> Result<RangedValue<SupportedPythonVersion>, UvWorkspaceError> {\n    let [major, minor, ..] = version.release() else {\n        return Err(UvWorkspaceError::InvalidPythonVersion(version.clone()));\n    };\n    let version = format!(\"{major}.{minor}\")\n        .parse::<SupportedPythonVersion>()\n        .map_err(|_| UvWorkspaceError::InvalidPythonVersion(version.clone()))?;\n\n    Ok(RangedValue::new(version, ValueSource::UvWorkspace))\n}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/astral-sh/ruff/blob/fca5c7cf2cd2f8338f18b9485f936b8e9f07bd0b/crates/ty_project/src/uv/metadata.rs#L77-L113","documentation":"When ty detects a uv workspace, it runs `uv workspace metadata --frozen --active` to learn the workspace root and environment. The uv binary is located via the `UV` env var, falling back to a PATH search (`system.which(\"uv\")`); any WhichError (not found, unreadable PATH entries, unresolvable executable) is converted to an io::Error of kind NotFound with this message, surfacing as UvWorkspaceError::Invocation during environment discovery.","triggerScenarios":"ty (CLI or LSP inside an editor) opens a uv-managed project while `uv` is not on the process's PATH and `UV` is unset, or `UV` points to a path that cannot be resolved or executed.","commonSituations":"macOS GUI editors that do not inherit the shell PATH where uv was installed; CI images without uv; uv installed in a cargo/bin directory while the editor is launched from the Dock; `UV` pointing at a moved binary.","solutions":["Install uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`, brew, or pip) and restart the editor/terminal so PATH refreshes.","Set `UV` to the absolute path of the uv executable for the process running ty.","Launch GUI editors from a shell (`code .`) or fix the GUI environment's PATH (e.g. `launchctl setenv PATH ...` on macOS).","If the project should not be treated as a uv workspace, check for a stray [tool.uv] workspace marker or point ty at the intended Python environment in its settings."],"exampleFix":"# before: editor spawned without uv on PATH\n$ open -a 'Visual Studio Code' .   # ty logs: failed to resolve uv executable\n\n# after: pin the resolver via UV and launch from a shell\n$ export UV=\"$(command -v uv)\" && code .","handlingStrategy":"validation","validationCode":"#!/bin/sh\nif ! command -v uv >/dev/null 2>&1; then\n  echo \"uv not found on PATH; ty needs it for uv workspaces\" >&2\n  exit 1\nfi\nexport UV=\"$(command -v uv)\"   # pin it for children like the editor/ty","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install uv on every machine/CI image that opens uv-managed projects with ty.","Launch GUI editors from a shell or fix the GUI PATH so ~/.local/bin and cargo bins are visible.","Set UV to an absolute path in environments where PATH cannot be trusted."],"tags":["ty","uv","path","executable-not-found","environment"],"backgroundTag":"executable-not-found","analyzedSha":"fca5c7cf2cd2f8338f18b9485f936b8e9f07bd0b","analyzedAt":"2026-08-20T16:33:49.445Z","contentChangedAt":"2026-08-20T16:33:49.445Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}