具有PySide2和Pyinstaller的应用程序在Linux中生成192MB的文件,但在Windows上生成70 mb的文件

时间:2019-10-22 19:46:26

标签: python linux pyinstaller pyside2

我正在使用PyInstaller制作一个独立的PySide2应用程序,但是在Linux上文件大小很大,在Windows中,.exe大小仅为70mb,而在Linux中则为192MB

在两种情况下,构建都是使用仅具有必要模块的虚拟环境进行的。看起来问题出在PySide2上,因为带有标签的小窗口生成129.3 MB文件。有谁知道如何解决这个问题?

这是一个用于pyinstaller的MWE,产生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()
  

信息:

     

windows 10

     

linux mint 19.2

     

Linux上的python 3.7.5 64位

     Windows上的

python 3.7.4 32位

     

pyinstaller:4.0.dev0 + a9b299995

     

PySide2:5.13.0

     

命令:../venv/bin/pyinstaller --onefile mwe.py

编辑1:

我在Windows和Linux中都检查了pyside2的大小,在Linux中它要重得多,超过450 mb,而在Windows中只有300 Mb

0 个答案:

没有答案