Another approach: create a venv and install only what you want packaged. The Pyinstaller dependency analysis is conservative -- if there's a case where package x might be needed, it will be included. It can't tell what your use-case is.
On Thu, Nov 7, 2019 at 6:11 AM Brendan Simon (eTRIX) < [email protected]> wrote: > On 7/11/2019 9:44 pm, Hartmut Goebel wrote: > > Am 06.11.19 um 23:35 schrieb Brendan Simon (eTRIX): > > Is there a way to get PyInstaller to only package the modules that the app > will use (other than commenting out code everywhere?) > > pyinstaller --help is your friend. > > I have been through all the documents and stackoverflow. I am using a > spec file and have been playing with filtering out various files before > producing the exe. e.g. removing all the ".npy" and ".npz" data files that > I don't need. > > So running `pyinstaller --help` did help me focus back on > `--exclude-module`. This by itself doesn't do what I want, which is for > pyinstaller to not include modules it never sees (or what the app would > never see if run). Maybe that's not possible to do? > > Anyway using `--exclude-module` at command line would mean I need > different scripts with different sets of command arguments (or one script > with some settings). > > Thinking about it more, I could probably do it in the spec file too, by > importing those CONFIG attributes from the app and setting the `excludes` > list as required. > > I'll give that a whirl. > > Vielen Dank ! > > > -- > You received this message because you are subscribed to the Google Groups > "PyInstaller" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pyinstaller/6fc2db98-9829-19bb-92cb-3173c0537286%40etrix.com.au > <https://groups.google.com/d/msgid/pyinstaller/6fc2db98-9829-19bb-92cb-3173c0537286%40etrix.com.au?utm_medium=email&utm_source=footer> > . > -- Bryan A. Jones, Ph.D. Associate Professor Department of Electrical and Computer Engineering 231 Simrall / PO Box 9571 Mississippi State University Mississippi State, MS 39762 http://www.ece.msstate.edu/~bjones bjones AT ece DOT msstate DOT edu voice 662-325-3149 fax 662-325-2298 Our Master, Jesus Christ, is on his way. He'll show up right on time, his arrival guaranteed by the Blessed and Undisputed Ruler, High King, High God. - 1 Tim. 6:14b-15 (The Message) -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CAHhYbD-FUKjRHtg-fkeDDDgeRgDD6Gm4i53jncK-8PQhdXgi_w%40mail.gmail.com.
