Search code examples
python-3.xmatplotlibpyqtpyinstaller

Pyinstaller executable dependant on external python installation


I have a few python applications that use the same environment. The applications use matplotlib and Qt and as a result, a single file executable created using pyinstaller is around 200+ MB. I suspect, the bulk of this is made up by the DLLs. All applications combined are about a 1 GB+ download.

Is there any way that I can create an executable which can be linked to an external python installation or environment? That way I can build smaller executables and link them all to the same python installation. Also, updating my applications will mean much smaller downloads.


Solution

  • Looking at the documentation in https://pyinstaller.org/en/stable/operating-mode.html

    There are two ways to build an executable, one folder solution or one file solution.

    One file solution resorts to all dependencies being packaged into one executable. This is the case you do not want.

    Alternatively, the one folder solution allows you to have an executable AND all the dependencies packaged into the folder. That is you will have libraries in the folder.

    I suspect you can use the one folder solution for all the app's but than move all the applications into "one of the folders". That way all the applications share the libraries in the folder.