'An application with PySide2 and Pyinstaller generates a 192MB file in Linux but 70 mb on windows

I'm making a stand alone PySide2 application with PyInstaller, but the file size is huge on Linux, in windows the .exe size is just 70mb while in Linux is 192MB

In both cases the build was made using a virtual environment only with the necessary modules. Looks like the problem is PySide2, since a tiny window with a label produce a 129.3 MB file. Does anyone knows how to address this problem?

This is a MWE for which pyinstaller produces a 129.3 MB:

import sys
from PySide2.QtWidgets import QApplication, QLabel

# Create a Qt application
app = QApplication(sys.argv)
# Create a Label and show it
label = QLabel("Hello World")
label.show()
# Enter Qt application main loop
app.exec_()
sys.exit()

info:

windows 10

linux mint 19.2

python 3.7.5 64 bits on linux

python 3.7.4 32 bits on windows

pyinstaller: 4.0.dev0+a9b299995

PySide2: 5.13.0

command: ../venv/bin/pyinstaller --onefile mwe.py

Edit 1:

I checked the size of pyside2 in both Windows and Linux, and it is much heavier in Linux, more than 450 mb while in Windows it is only 300 Mb



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source