I have an app and am experimenting with various modules (opencv,
skimage, harvester etc).

Using PyInstaller my self contained exe (--onefile) is huge (120+MB) and
takes a long time to startup.

I recently modified the code selectively import various modules if they
are required (to see which ones perform best and how they get packaged),
but PyInstaller seems to import/collect/package them even if the app
never uses them.

simple example.

    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


Am I right that PyInstaller will include all modules (opencv, skimage
and harvester) in the bundle regardless of the CONFIG settings ?

Is there a way to get PyInstaller to only package the modules that the
app will use (other than commenting out code everywhere?)

Thanks, Brendan.

-- 
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/3b7e1c82-ece7-1d38-1cf8-8e12251c9e33%40etrix.com.au.

Reply via email to