We have a standalone PyQGis windows application that is packaged into a multi-file folder by PyInstaller (3.2.1). The OSGeo4W64 python environment is used in the application and the spec file is very similar to the one posted in this other question thread:
The resulting package works fine, except its size is very large. In particular, it automatically pulled in libraries such as the following, among other things:
LIBEAY32.dll libifcoremd.dll libifportmd.dll libiomp5md.dll libiompstubs5md.dll libmmd.dll libmysql.dll libpng16.dll LIBPQ.dll libsodium.pyd libtiff.dll wxbase28uh_net_vc.dll wxbase28uh_vc.dll wxmsw28uh_adv_vc.dll wxmsw28uh_core_vc.dll wxmsw28uh_html_vc.dll mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.CRT.manifest Microsoft.VC90.MFC.manifest msvcm90.dll MSVCP100.dll msvcp90.dll MSVCR100.dll msvcr90.dll
We removed these libraries to reduce the package size, but how to prevent the Pyinstaller from including these and other non-essential libraries or binaries in the first place? I think one way is to explicitly exclude these using the 'exclude' clause, but I am hoping there is a more systematic way to do this, for example, is there a way to signal to PyInstaller to only go after the first level of dependencies (not to include others recursively).