From b8d70539ec3273298fcc8d370a029bcf619d48d8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 23:05:23 -0700 Subject: [PATCH] Fix uv pip install: use venv dir not python binary path, add .exe on Windows - uv pip --python works better with the venv directory path than the python binary path (avoids "No virtual environment found" on Windows) - Add .exe suffix to Windows python path for non-uv fallback Co-Authored-By: Claude Opus 4.6 (1M context) --- python/build_sidecar.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/build_sidecar.py b/python/build_sidecar.py index 6445de5..1b2c68d 100644 --- a/python/build_sidecar.py +++ b/python/build_sidecar.py @@ -92,14 +92,18 @@ def create_venv_and_install(cpu_only: bool) -> Path: # Determine python path inside venv if sys.platform == "win32": - python = str(venv_dir / "Scripts" / "python") + python = str(venv_dir / "Scripts" / "python.exe") else: python = str(venv_dir / "bin" / "python") def pip_install(*args: str) -> None: """Install packages. Pass package names and flags only, not 'install'.""" if use_uv: - subprocess.run(["uv", "pip", "install", "--python", python, *args], check=True) + # Use --python with the venv directory (not the python binary) for uv + subprocess.run( + ["uv", "pip", "install", "--python", str(venv_dir), *args], + check=True, + ) else: subprocess.run([python, "-m", "pip", "install", *args], check=True)