Do not import imgui_bundle.immapp.immapp_notebook by default
Hello Team!
When importing imgui_bundle, it imports by default immapp which imports immapp_notebook. Inside immapp_notebook there is _run_app_function_and_display_image_in_notebook() that will import cv2, PIL, IPython
When using pyinstaller to freeze the my python entry point to a .exe it will detect imports of cv2/Pil/IPython and will embed them in final build.
Would it be possible to remove from immapp_init_.py the from imgui_bundle.immapp.immapp_notebook import run_nb as run_nb ?
So users currenlty doing like this
from imgui_bundle import immapp
immapp.run_nb()
would have to do do like this
from imgui_bundle.immapp.immapp_notebook
immapp_notebook .run_nb()
This will solve issue with pyinstaller embedding things that should not be here.
Thank you!
Bonjour !
Removing this import would change the API for end-users, so I am wary to do it without a full analysis of the impact.
In the meantime, you could also use
pyinstaller … --exclude-module cv2 --exclude-module PIL --exclude-module IPython
Thanks, this is what I'm doing for now. But I'd like to not hardcode hacks like this in my app. Let's say cv2 is required by a new feature, it may be not obvious to detect why frozen release is broken. And if you change the immapp to import an other package, I may not detect that it should be ignored too.
I pushed https://github.com/pthom/imgui_bundle/commit/6bd55c995f759d06f988fac47abdb16c1fc24c98
Can you tell me if it is enough to solve the issue on your side?