Skip to content

Conversation

jglanz
Copy link

@jglanz jglanz commented Jul 27, 2025

Quick & dirty fix for KiCad Python Paths on Windows

NOTE: This is quick & DIRTY, better error handling and error messages should be added in addition. Also, Vec<Path> find first should be added checking all provided candidates, etc

  • Made venv site-packages path resolution more robust by checking interpreter parent path
  • Added user install location for KiCad interpreter check

Copy link
Contributor

@LK LK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment on lines +63 to +67
std::env::var("KICAD_PYTHON_INTERPRETER")
.unwrap_or_else(|_| "python.exe".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this default to using the system python.exe if KICAD_PYTHON_INTERPRETER isn't defined?

Copy link
Author

@jglanz jglanz Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual interpreter will/should run from the PATH, but the site-packages functions will not recognize the directory structure.

Personally, I'd create a fallback fn to scan the path (equivalent ofwhich) would facilitate what you are suggesting in a more complete way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just updated the PR to resolve a compilation issue the windows fix caused the other build targets

…interpreter` parent path

- Add `user` install location for `KiCad` interpreter check

> NOTE: This is quick & DIRTY, better error handling and error messages should be added in addition.  Also, `Vec<Path>` find first should be added checking all provided candidates, etc
@jglanz jglanz force-pushed the fix/kicad-paths-for-windows branch from 5866d38 to bb81b46 Compare July 28, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants