wxPython in an executable Python zip archive

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?

I have not tried any of the techniques described, but perhaps the following article might help:

Thanks. This is useful.

pyinstaller is not cross platform, so that is ruled out.

I have used py2exe in the past, but this is such a small app that pyz seemed more appropriate.

At the moment I’m considering going for CLI and abandoning the GUI :frowning:

There’s always tkinter (if you don’t mind its rather archaic appearance).

It should be built-in with most Python installations.

Yes - thought of that too -maybe I should learn it

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.

I do not have access to Windows

Loading extension modules (pyd) from a ZIP archive (egg, whl, etc.) is not supported in Windows.