【发布时间】:2019-10-22 03:27:54
【问题描述】:
以下代码是我在pyqt小部件中使用的模块,但是我使用pyinstaller构建exe文件后,文件大小为233MB。
如何减小文件大小?
我尝试创建一个新的虚拟环境,但没有任何改善,我也尝试在我的 pyinstaller spec 文件中添加excludes=['mkl','whl'],但也没有改善。
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QApplication, QFileDialog
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtCore import Qt, pyqtSignal, QEvent
import sys
from glob import glob
from numpy import array as nparray
from PIL.Image import open as imopen
from win32gui import GetWindowText, GetForegroundWindow
from MainWindow import Ui_MainWindow, resource_path
from qimage2ndarray import array2qimage
from shutil import move
from os import makedirs, chdir, getcwd
from os import path as ospath
MainWindow是我用qtdesigner构建的UI代码,它使用的模块是:
from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QStatusBar
from PyQt5.QtCore import QRect, Qt, QSize, QMetaObject, QCoreApplication
from PyQt5.QtGui import QFont, QIcon, QPixmap
import sys
from os.path import join, abspath
【问题讨论】:
标签: python python-3.x pyqt5 exe pyinstaller