From 75d4e4e3cf00d9d2c20e11fa9e61e2781b69ab7d Mon Sep 17 00:00:00 2001 From: ryanking13 Date: Fri, 28 Nov 2025 20:59:29 +0900 Subject: [PATCH] Redirect python cli to batch file in windows --- pyodide_build/out_of_tree/venv.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyodide_build/out_of_tree/venv.py b/pyodide_build/out_of_tree/venv.py index 69cdd924..9615cd0a 100644 --- a/pyodide_build/out_of_tree/venv.py +++ b/pyodide_build/out_of_tree/venv.py @@ -29,6 +29,9 @@ ] +IS_WIN = sys.platform == "win32" + + def dedent(s: str) -> str: return textwrap.dedent(s).strip() + "\n" @@ -324,7 +327,14 @@ def create_pyodide_venv(dest: Path, virtualenv_args: list[str] | None = None) -> logger.info("Creating Pyodide virtualenv at %s", dest) from virtualenv import session_via_cli - interp_path = pyodide_dist_dir() / "python" + python_exe_name = "python.bat" if IS_WIN else "python" + interp_path = pyodide_dist_dir() / python_exe_name + + if not interp_path.exists(): + logger.error( + "ERROR: Pyodide python interpreter not found at %s\n", + interp_path, + ) cli_args = ["--python", str(interp_path)]