You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run your frozen program from a command window (shell) — instead of double-clicking on it
Package your program in --onedir mode
Package without UPX, say: use the option --noupx or set upx=False in your .spec-file
Repackage you application in verbose/debug mode. For this, pass the option --debug to pyi-makespec or pyinstaller or use EXE(..., debug=1, ...) in your .spec file.
In linux environment described above, pyinstaller produces a >600MB directory, which includes a lot of unused but huge Qt libraries such as libQt6WebEngineCore.so.6(175.9MB). In contrast, pyinstaller in MacOS produces a 86.9MB directory with only necessary libraries inside.
The text was updated successfully, but these errors were encountered:
Hmm, that's actually PyInstaller's dependency resolution working as intended...
The problem is that in linux PySide6 wheels, all extension modules (e.g., site-packages/PySide6/QtCore.abi3.so) are for some reason linked against libQt6Qml.so.6, which causes PyInstaller to pull in PySide6.QtQml. And because we have no way of tracking QML imports and dependencies, we collect all QML data, which includes plugins that are linked to all the extra libraries (for example site-packages/PySide6/Qt/qml/QtWebEngine/libqtwebenginequickplugin.so is linked against libQt6WebEngineCore.so.6).
Adding --exclude PySide6.QtQml to your PyInstaller command should prevent PySide6.QtQml from being pulled in and reduce the amount of collected Qt6 libraries.
We should probably modify our hook utilities to avoid adding the Py*.QtQml sub-package to hiddenimports even if there is a shared library dependency, as it makes no sense for a simple widgets-based application to pull in everything...
So it is like a PySide6 "issue". Since pyinstaller is working as intended and the workaround you provided is great, I'm closing this issue. I would like to see the feature which enables pyinstaller to detect useless QtQml dependency to be integrated in the future. Thank you!
Description of the issue
Context information (for bug reports)
Output of
pyinstaller --version
: 4.7Version of Python: 3.9.7
Platform: Ubuntu 21.10 x86_64
How you installed Python: apt
Did you also try this on another platform? Does it work there? Both MacOS and Windows are good here.
try the latest development version, using the following command:
(https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and
Make sure everything is packaged correctly
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.A minimal example program which shows the error
Init a clean workspace
PySide6 version info:
Just a "helloworld" example from PySide6 document
Package it
In linux environment described above, pyinstaller produces a >600MB directory, which includes a lot of unused but huge Qt libraries such as
libQt6WebEngineCore.so.6
(175.9MB). In contrast, pyinstaller in MacOS produces a 86.9MB directory with only necessary libraries inside.The text was updated successfully, but these errors were encountered: