【问题标题】:Is there anyway to reduce the .exe file size made by pyinstaller?有没有办法减少pyinstaller制作的.exe文件大小?
【发布时间】:2022-08-19 06:01:12
【问题描述】:

所以我做了一个超级简单的程序,有 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()

标签: python compression pyinstaller pysimplegui


【解决方案1】:

原因 pyinstaller 将您当前的 python 核心和附加模块(递归搜索文件和模块中的导入)的副本包含到您的构建中。例如,Python 核心 .dll 的大小约为 3.5Mb。

【讨论】:

    猜你喜欢
    • 2018-05-21
    • 2022-08-23
    • 1970-01-01
    • 1970-01-01
    • 2021-09-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多