Just to summarize the options here when I use them.
PyInstaller TOC - there is, as the documentation says:
A TOC is a list of tuples of a form (name, path, TypeCode). This is actually an ordered set, not a list. TOC does not contain duplicates where uniqueness is based only on a name.
In other words, simply:
a_toc = [('uname1','/path/info','BINARY'),('uname2','/path/to','EXTENSION')...]
So, in your .spec file - after you get the results of the analysis of the script, you can additionally change the corresponding TOC:
For specific files / modules, use the difference (-) and intersection (+) operations to change the TOC. *
To add / remove lists of files / modules of iteration by TOC and comparison with the template matching code.
(* Aside, for the difference in work, it seems you should use TOC() explicitly and note that, since this is only a name that uniquely identifies a collection element, you only need to indicate that - therefore ('sqlite3', None, None) etc.)
An illustrative example (taken from a .spec file) is below, where - for better or worse - I delete all links to scipy, IPython and zmq; remove specific sqlite, tcl / tk and ssl.DLL; insert the missing opencv.DLL; and finally delete all data folders found separately from matplotlib ...
Whether the resulting Pyinstaller.exe will work when the .pyc file tries to load the expected .DLL is controversial :-/
# Manually remove entire packages... a.binaries = [x for x in a.binaries if not x[0].startswith("scipy")] a.binaries = [x for x in a.binaries if not x[0].startswith("IPython")] a.binaries = [x for x in a.binaries if not x[0].startswith("zmq")]
tiluki
source share