Edit: The key was using msys2. After installing Gtk3 and PyGObject following the PyGObject guide for msys2 everything worked fine. Packaging with PyInstaller and nuitka was fine.
I've been developing an image halftoning app for a while using GTK on Linux, thinking GTK is cross platform, and delaying testing it on Windows for quite some time.
Today I decided to finally install Windows 10 (for the first time in more than a decade) on a separate machine and see what works and what does not.
For the past few hours I've been through hell trying to get GTK3 to work. I've followed multiple guides, none of which worked, including wingtk.
Furthermore, even if I successfully compile (or install) GTK, would it be possible to package it all up using something like PyInstaller or nuitka.
At this point I'm thinking of keeping the functions and writing a whole new GUI in Tk for the Windows port, as at least that seems to work.
Am I missing something?
Yeah I keep running into similar issues when trying to build pretty much anything on windows; for stuff that can't be 'nicely' configured & dependency-managed through an IDE, windows is pure pain.
It really sounds like PySide would fit your use case better. Check out this website for a great starting point: https://www.pythonguis.com/pyqt6/ -- the author also has an entire book on packaging PySide programs for cross-platform distribution.
As for installing Python itself; I think I'd stick with the plain installer from python.org, and afterwards, pip. In case of dependencies that are hard to get through PyPi, I think anaconda might be worth looking at as well: https://www.anaconda.com/download
msys2 provides a package manager, & several development toolchains; it's an easy way to get native (mingw) gcc & bash on windows; cross-platform programs rely on it heavily, because it saves them from all the 'visual studio' BS: https://www.msys2.org/docs/what-is-msys2/ -- I believe any implementation of GTK on windows requires a mingw toolchain.
You seem to be right. It finally compiled successfully a few minutes ago, installed pygobject successfully, following the instructions and it claims the gi module could not be found, even though pip lists it as installed. I really don't know how Windows developers deal with such things. Do they just avoid known bad libraries?
I've decided on following the exact steps in the wingtk guide, as my attempts to deviate from them resulted in quicker failure, hence installing it through choco.
While I'm sure Qt may be a better option, this project is a companion app to my PhD thesis to make the algorithms discussed somewhat easily available to a somewhat general audience and is completely unpaid so I really don't feel like learning a new GUI framework for it. Maybe I'll make a quick and ugly pysimplegui UI for Windows users.
Anyway, I'm sorry for ranting. Thank you so much for the suggestions and explanations! It's really appreciated.