使用pyins将pyqt构建为exe后的大文件大小

2024-09-30 00:27:37 发布

您现在位置:Python中文网/ 问答频道 /正文

下面的代码是我在pyqt小部件中使用的模块,但是在我使用pyinstaller构建exe文件之后,文件大小是233MB。你知道吗

如何减小文件大小?你知道吗

我尝试创建一个新的虚拟环境,但没有改进,我还尝试在pyinstallerspec文件中添加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

Tags: 模块文件path代码fromimportosas

热门问题