I have tried various approaches to this over the years - this is definitely challenging. My requirements include: a) needing wx, numpy, matplotlib, and some custom scientific libraries, b) wanting “desktop shortcuts/apps” for end-users, c) wanting “no admin” install, fully in user-owned folders and easily uninstalled, and d) a preference for including a real Python environment and readable source code. I realize that might be a set of priorities that others do not share. But, I should also say that I have not had much success with the various “python to executable app” approaches, especially on all platforms.
For the past several years, I’ve been using Anaconda Python (or “miniconda”) and use either
conda constructor (https://github.com/conda/constructor) or custom shell scripts to run the installation steps. One reason for this is that Anaconda Python and especially
conda-forge keeps an up-to-date wxPython for all platforms, including Linux, has packages for all the normal scientific code, and is pretty well tested. The downsides are that
conda is actually pretty slow, and that the set of latest packages changes rather often. One could hard-code in every package version - I find that mostly unnecessary, but it might be a wise thing to do.
With both constructor or shell/batch scripts, you can customize a “post-install” step. With “basic conda packages” already installed, I can use this to step to fix or update packages, say installing with
pip. This is also where I build desktop shortcuts/apps (my main package has multiple apps, and at least so “python to executable app” tools don’t support that) using (shameless plug?)
pyshortcuts (https://github.com/newville/pyshortcuts). And, since it is Anaconda Python and wxPython, this is also where I take care to fix the super-annoying Anaconda bug on macOS which requires running wxPython apps with
pythonw.app instead of
For me, another important consideration is how often I need to update packages and rebuild these installation scripts. I’ve been relying more and more on that “post-install script” to automatically update packages so that I can simply update packages on conda-forge or PyPI, and the same installer will then grab the latest version. This also allows knowledgeable users can update with
pip without having to install a completely new environment, or my apps can alert users that an update is available.
The shell (bash/Windows cmd) scripts and conda constructor scripts I use for my main app are at
(xraylarch/installers at master · xraypy/xraylarch · GitHub). Maybe you’ll find that approach useful.