python issue when setting up Windows build environment

147 views
Skip to first unread message

Nicholas Burns

unread,
Oct 27, 2024, 11:41:19 AM10/27/24
to KiCad Developers
Hello. I've been trying to set up a build environment for KiCAD under Windows, following the visual studio build guide. I've avoided VS like the plague until now - but for this project I was willing to dip my toes!

I've run into a python related problem during the CMake configuration phase. It collects and builds various packages through vcpkg, as expected, but trips up on wxpython. Investigating the log file I'm pointed to (D:\External_Gitlab_Projects\vcpkg\buildtrees\wxpython\get-pip-x64-windows-err.log) I find on the last line, "ModuleNotFoundError: No module named 'distutils'"

I've done some looking around, and the most hopeful solution I found was to uninstall all installations of Python and try again... but unfortunately, this has not solved my problem.

I have to admit - I'm stuck! Probably something simple because I'm not familiar with the toolchain. Any help would be fantastic though : )

Mark Roszko

unread,
Oct 27, 2024, 11:50:02 AM10/27/24
to dev...@kicad.org
It kind of sounds you have a broken build environment already somehow. 
That error is expected if python 3.12 is used but we have python 3.11 specified in our vcpkg config and its maintained in our vcpkg registry layer.

Do you have a system install of python 3.12? I have fought for many years trying to get it ignored from the vcpkg build but python is literally cancer and has numerous backdoors detection methods to keep picking up the system install.


--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion visit https://groups.google.com/a/kicad.org/d/msgid/devlist/e2c3bdbe-b5d7-44be-893f-ea292c8add73n%40kicad.org.

Nicholas Burns

unread,
Oct 27, 2024, 12:04:21 PM10/27/24
to KiCad Developers, mark....@gmail.com
I had a system install of Python 3.7-odd installed I believe, but have uninstalled following the error. I then restarted the computer, went back into Visual Studio, went to Build->Delete Cache and Reconfigure, and ran into the same problem. Should I just wipe the KiCAD and vcpkg folders and try again from scratch because something has been polluted by the existing installation? I was holding off doing that due to the time it takes to compile all the dependencies!

Ethan Chien

unread,
Oct 27, 2024, 1:01:10 PM10/27/24
to dev...@kicad.org
I have been fighting with python 3.12 too , the solution I found is to navigate to the vcpkg registry dir , reset it hard to an earlier commit in which python 3.11 is its default .

Take a look at my kicad-win-builder mirror on Github in which the older vcpkg  (3 months ago)  is referenced. It built the KiCad 8.0.5 successfully few days ago.

Nicholas Burns

unread,
Oct 27, 2024, 1:48:02 PM10/27/24
to dev...@kicad.org
Not sure I follow this clearly... Do I use GIT to downgrade vcpkg? If so, then my tenuous grip of GIT may be a problem! Though I'm sure I can work that out if I need to. However, is it not a bad idea to downgrade vcpkg to an earlier version to try and solve this problem? Does that not result in multiple packages being older than they should be?

Ethan Chien

unread,
Oct 27, 2024, 2:02:14 PM10/27/24
to dev...@kicad.org
The root cause of this build issue is that some modules required by the get-pip-x64-windows package have been removed in python 12. Either patch the get-pip-x64-windows package in the vcpkg fork or wait until its maintainer upgrades it to accommodate Python 12
BTW, vcpkg will always download and use the version of python specified in its meta configuration file

Mark Roszko

unread,
Oct 27, 2024, 7:38:46 PM10/27/24
to dev...@kicad.org
Yea the shitshow is I can't arbitrarily update python in our kicad packaging without potentially breaking python plugins lol. So I rather leave it until 9.0

But I wonder if i can pin something in our tree hmmm

Mark Roszko

unread,
Oct 27, 2024, 8:14:13 PM10/27/24
to dev...@kicad.org
I pinned vcpkg-get-python-packages in the kicad repo to the older version, might work

Nicholas Burns

unread,
Oct 29, 2024, 5:28:21 AM10/29/24
to KiCad Developers, mark....@gmail.com
So - with some kind help from Mark, I have got past the wxPython issue. It required a rollback of vcpkg as suggested here - but I also needed a little extra hint regarding git usage to rollback successfully. I rolled back to the last commit of September.

I now have another problem... but that doesn't match the title of this thread, so I'll bring it up elsewhere if I can't work it out myself : D

Thanks Mark!

Reply all
Reply to author
Forward
0 new messages