I am developing a small app (on *nix) that I wish to distribute to users (who in general will be Windows users). It seemed that an executable archive (.pyz) was the best approach.
I installed wxPython into my build directory using
python -m pip install wxPython --target build
When I create my .pyz file and attempt to run it I get the error
No module named 'wx._core'
As I was investigating this I came across this answer, which implies that you need a different core on depending on the OS. I don’t want user to have to install wxPython themselves, so should I abandon this approach?
It depends on how much you like your users and how much technical sophistication you want to require of them. Windows users won’t like CLI, at least in my experience.
I use PyInstaller on Windows and macOS, and their documentation implies that it works on Linux as well. I’m surprised you say it is not cross-platform, as that’s not my experience with it.
You should use a Python version with an available wxPython binary.
You can check this on the PyPi page: wxPython · PyPI
So, currently you should probably use Python 3.10.
Perhaps a difference in understanding. By cross platform I mean create on linux, run on Windows. See docs
PyInstaller is tested against Windows, MacOS X, and Linux. However, it is not a cross-compiler; to make a Windows app you run PyInstaller on Windows, and to make a Linux app you run it on Linux, etc.