{"record":{"id":"d0edf600be60181b","repo":"windmill-labs/windmill","slug":"cannot-list-python-versions-is-uv-0-5-19-and-new","errorCode":null,"errorMessage":"Cannot list python versions, is uv (0.5.19 and newer) installed? Err:\n{}","messagePattern":"Cannot list python versions, is uv \\(0\\.5\\.19 and newer\\) installed\\? Err:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/python_versions.rs","lineNumber":369,"sourceCode":"                        )\n                    }\n                })\n                .collect::<Result<Vec<PyV>, Error>>()?\n                .into_iter()\n                .unique()\n                .sorted()\n                .filter(|pyv| filter.contains(&*pyv))\n                .rev()\n                .collect_vec();\n\n            *LAST_CHECKED.write().await = Utc::now();\n            CACHED_VERSIONS.write().await.replace(list.clone());\n\n            Ok(list)\n        } else {\n            // If the command failed, print the error\n            let stderr = String::from_utf8(output.stderr)?;\n            bail!(\n                \"Cannot list python versions, is uv (0.5.19 and newer) installed? Err:\\n{}\",\n                stderr\n            );\n        }\n    }\n\n    /// Parse lockfile for assigned python version.\n    /// If not found returns 3.11\n    pub fn parse_from_requirements<S: AsRef<str>>(requirements_lines: &[S]) -> Self {\n        Self::try_parse_from_requirements(requirements_lines).unwrap_or(\n            // If there is no assigned version in lockfile we automatically fallback to 3.11\n            // In this case we have dependencies or other metadata, but no associated python version\n            // This is the case for old deployed scripts\n            PyVAlias::default().into(),\n        )\n    }\n\n    /// Parse lockfile for assigned python version.","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/python_versions.rs#L351-L387","documentation":"Windmill uses `uv python list` to discover installable Python versions for worker-side Python environments. If the uv command exits non-zero (uv missing, too old, not on PATH, or broken), the stderr is surfaced wrapped in this message asking whether uv >= 0.5.19 is installed.","triggerScenarios":"Listing available Python versions (worker startup / Python version picker) when `uv` is not installed, is older than 0.5.19 (which added `python list`), is not on the worker process's PATH, or otherwise exits non-zero — the stderr appears after `Err:`.","commonSituations":"Self-hosted worker image without uv; uv installed via a version manager not visible to the worker's PATH; an old uv pinned in a Dockerfile; a corrupted or permission-broken uv binary.","solutions":["Install uv >= 0.5.19 on the worker, e.g. `curl -LsSf https://astral.sh/uv/install.sh | sh`, or bump the pinned uv in the worker Dockerfile","Ensure the uv binary is on the PATH of the worker process (system-wide, e.g. /usr/local/bin, not only a user shell's ~/.local/bin)","Run `uv python list` manually as the worker's user and read the raw stderr from the message to fix the underlying failure","Restart the worker after installing/upgrading uv"],"exampleFix":"# before (Dockerfile)\nRUN apt-get install -y python3\n# after\nRUN curl -LsSf https://astral.sh/uv/install.sh | sh && uv --version # >= 0.5.19","handlingStrategy":"try-catch","validationCode":"#!/bin/sh\ncommand -v uv >/dev/null 2>&1 || { echo 'uv not installed'; exit 1; }\n[ \"$(uv --version | awk '{print $2}' | tr -d .)\" -ge 519 ] || { echo 'uv too old (<0.5.19)'; exit 1; }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"Cannot list python versions\") => {\n        // provision uv >= 0.5.19 on the worker, then retry\n    }\n    other => other?,\n}","preventionTips":["Bake uv >= 0.5.19 into worker images at a system PATH location","Pin and verify the uv version in CI before deploying workers","Smoke-test Python version listing on worker startup health checks","Avoid installing tools only in interactive shells the worker never sees"],"tags":["python","uv","worker-setup","missing-dependency","environment"],"backgroundTag":"missing-required-binary","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}