[英]Overly large .exe file when using pyinstaller
我搜索了一下這個問題,人們抱怨可執行文件大小為30mb~100mb,但出於某種原因我的是300mb。 我可能錯了,但我不認為這是正常的。 我嘗試使用其他替代品,如cx_Freeze,但我得到了相同的結果。 這是我在項目中的包含:
from PyQt5 import QtCore, QtGui, QtWidgets
from pyplot import functions as plot
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(window)
window.show()
sys.exit(app.exec_())
pyplot是我項目的另一個python文件,包括:
from numpy import power, cbrt, sin, cos, arange
from matplotlib import pyplot as plt
from matplotlib import patches as pts
from scipy import integrate as intg
我使用此命令來創建我的可執行文件:
pyinstaller --onefile --windowed montecarlo.py
謝謝你的幫助
這是正常的,因為您導入的包具有一些大的傳遞依賴性。
要量化每個包的貢獻,只需注釋掉所有導入,運行pyinstaller,然后逐個添加它們,注意每個包后面的pyinstaller輸出的大小。 但是,您可能無法在統計數據中找到操作項,因為您的應用程序無論如何都需要這些導入。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.