From ebb58e0dc7cc104e0bbfd90cf7f37e40ffd0bbf5 Mon Sep 17 00:00:00 2001 From: pyranota <92104930+pyranota@users.noreply.github.com> Date: Tue, 4 Mar 2025 22:05:45 +0300 Subject: [PATCH] fix(python): windows worker fails to install 3.10 (#5409) ``` execution error:\nFind python error: error: Failed to inspect Python interpreter from managed installations at `C:\\tmp\\windmill\\cache\\py_runtime\\cpython-3.10.16-windows-x86_64-none\\python.exe`\n Caused by: Querying Python at `C:\\tmp\\windmill\\cache\\py_runtime\\cpython-3.10.16-windows-x86_64-none\\python.exe` failed with exit status exit code: 1\n\n[stderr]\nFatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python\nPython runtime state: preinitialized\n" ``` --- backend/windmill-worker/src/python_executor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 83fbe94cf4..1180652d35 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -364,6 +364,8 @@ impl PyVersion { let mut child_cmd = Command::new(uv_cmd); + child_cmd.env_clear(); + #[cfg(windows)] { child_cmd @@ -382,7 +384,6 @@ impl PyVersion { let output = child_cmd // .current_dir(job_dir) - .env_clear() .env("HOME", HOME_ENV.to_string()) .env("PATH", PATH_ENV.to_string()) .args([