CONFIG_USE_OPENCV = True
CONFIG_USE_SKIMAGE = False
CONFIG_USE_HARVESTER = False
if CONFIG_USE_OPENCV :
import cv2 as cv
if CONFIG_USE_SKIMAGE :
from skimage.transform import rescale
if CONFIG_USE_HARVESTER :
from harvester import Harvester
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.
Goebel Consult, Landshut
http://www.goebel-consult.de
Blog:
https://www.goe-con.de/blog/kamera-safari-durch-die-munchner-innenstadt
Kolumne:
https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht
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 pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/6fc2db98-9829-19bb-92cb-3173c0537286%40etrix.com.au.
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?
???
PyInstaller eo exactly this: Include only the modules it "sees". Which is: are imported by your code (or recursively by any module your code uses) and are avalably in you Python installation.
e.g. removing all the ".npy" and ".npz" data files that I don't need.
I never hear about such files. What is it?
Goebel Consult, Landshut
http://www.goebel-consult.de
On 8/11/2019 3:13 am, Hartmut Goebel wrote:
e.g. removing all the ".npy" and ".npz" data files that I don't need.I never hear about such files. What is it?
Numpy arrays stored to file. ".npy" files have a header followed by binary data. ".npz" are compressed versions of ".npy". opencv and/or skimage have a bunch of data files (sample images), which the user can load for testing algorithms, etc.
PyInstaller adds them to the bundle, even
if I never use any of them. To save space removing these from
the "datas" list in my spec file. Maybe there is a better way
by using hooks, but it's all just experimental at the moment.
Brendan.