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 <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user