From 9ee7f1a6140df2db75c4d77cc2c0cdb87a44ad69 Mon Sep 17 00:00:00 2001 From: navyd Date: Fri, 7 Mar 2025 19:39:52 +0800 Subject: [PATCH] fix: Unable to find uv when first creating py venv --- src/config/env_directive/venv.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config/env_directive/venv.rs b/src/config/env_directive/venv.rs index 1420d677a2..f813234162 100644 --- a/src/config/env_directive/venv.rs +++ b/src/config/env_directive/venv.rs @@ -69,8 +69,8 @@ impl EnvResults { p = display_path(&venv) ); } else { - let has_uv_bin = ts.which("uv").is_some() || which_non_pristine("uv").is_some(); - let use_uv = !SETTINGS.python.venv_stdlib && has_uv_bin; + let uv_bin = ts.which_bin("uv").or_else(|| which_non_pristine("uv")); + let use_uv = !SETTINGS.python.venv_stdlib && uv_bin.is_some(); let cmd = if use_uv { info!("creating venv with uv at: {}", display_path(&venv)); let extra = SETTINGS @@ -79,7 +79,8 @@ impl EnvResults { .clone() .or(uv_create_args) .unwrap_or_default(); - let mut cmd = CmdLineRunner::new("uv").args(["venv", &venv.to_string_lossy()]); + let mut cmd = + CmdLineRunner::new(uv_bin.unwrap()).args(["venv", &venv.to_string_lossy()]); cmd = match (python_path, python) { // The selected mise managed python tool path from env._.python.venv.python or first in list