簡體   English   中英

有沒有辦法減少pyinstaller制作的.exe文件大小?

[英]Is there anyway to reduce the .exe file size made by pyinstaller?

所以我用 1 個導入(它是pysimplegui )制作了一個超級簡單的程序,當我編譯它時,它的大小是 9 mb? py文件只有1 kb ...

有沒有辦法讓它至少小於 8 mb?

這是我的代碼:

import PySimpleGUI as sg

layout = [[sg.Text('Test app')]]

window = sg.Window('test app', layout, finalize=True)

while True:
    event, values = window.read()

    if event == sg.WIN_CLOSED:
        break

window.close()

原因 pyinstaller 將您當前 python 核心和其他模塊(遞歸搜索文件和模塊中的導入)的副本包含到您的構建中。 例如,Python core.dll 的大小約為 3.5Mb。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM