What's the best way to distribute wxpython apps for Linux?

Hello, I’m trying to work out what the best way to distribute my application written in WxPython for Linux is.

For Windows I’ve simply created an executable using PyInstaller. However, because almost every Linux system already has python preinstalled, that would be very inefficient in terms of disk space as it also bundles the python interpreter.

I was considering generating a PEX file, which relies on the pre-installed python but bundles all the dependencies with it, but then I remembered about the linux wheels being different from distro to distro, which means that my PEX which would be built using the ubuntu-20.04 wheels could possibly not work on other systems

Is there any solution to this other than just having the end user install wxpython themselves? Because that’s not exactly user-friendly.

Note that I’m not bothered with obscuring the source code as it’ll be in a public git repository anyway

Depending on whether your users trust you (not sure what the use-case is), you could write a shell script which detects the distro and installs everything properly when they run the script. Obviously, if the users are not very technical, it could be risky for them to run a script someone else made.

The other, better, option would be to just use pyinstaller (though that would be more work for you).

It’s not that it would be too much work for me - it’s that pyinstaller bundles the python interpreter as well as everything else, which causes ridiculous file sizes, in excess of 100MB, from a python script which takes up barely a few kilobytes.

Building on Windows yields a much more manageable size for some reason - around 11MB.

In theory this will be distributed publicly but in reality it’ll only be used by a few friends, most of whom are Windows users anyway. Possibly just writing a shell script would be a better way to go.

Yes, I’ve found that building with pyinstaller on linux tends to be about double the size as on windows. Not exactly sure why.

If these are friends, then they probably trust you and writing a shell script would probably be the way to go. For public, I would still go with pyinstaller, though.