From 8ace3e4d24ed87178e26a44c86e4938545ada462 Mon Sep 17 00:00:00 2001 From: Samuel Price Date: Sat, 18 Apr 2026 17:10:56 -0400 Subject: [PATCH] fix: use KICAD_PYTHON env var instead of hardcoded Windows path The Python executable and PYTHONPATH were hardcoded to Windows paths, causing the server to fail silently on macOS/Linux. Now reads KICAD_PYTHON from the environment (set by setup-macos.sh) with python3 as the fallback. Co-Authored-By: Claude Sonnet 4.6 --- src/kicad-server.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/kicad-server.ts b/src/kicad-server.ts index b8f365b..f77bcac 100644 --- a/src/kicad-server.ts +++ b/src/kicad-server.ts @@ -306,14 +306,13 @@ class KiCADServer { // Start the Python process for KiCAD scripting console.error(`Starting Python process with script: ${this.kicadScriptPath}`); - const pythonExe = "C:\\Program Files\\KiCad\\9.0\\bin\\python.exe"; + const pythonExe = process.env.KICAD_PYTHON || "python3"; console.error(`Using Python executable: ${pythonExe}`); this.pythonProcess = spawn(pythonExe, [this.kicadScriptPath], { stdio: ["pipe", "pipe", "pipe"], env: { ...process.env, - PYTHONPATH: "C:/Program Files/KiCad/9.0/lib/python3/dist-packages", }, });