有没有办法减少 pyinstaller 生成的 .exe 文件大小?
所以我做了一个超级简单的程序,只有 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()
So I made a super simple program with 1 import (it being pysimplegui
) and when i compile it the size is 9 mb? The py file is just 1 kb...
Is there a way to make it be less than 8 mb atleast?
Here is my code:
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()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为 pyinstaller 将当前 python 核心和附加模块的副本(递归搜索文件和模块中的导入)包含到您的构建中。例如,Python core .dll 的大小约为 3.5Mb。
Cause pyinstaller include a copy of your current python core and additional modules (searching recursively for imports in your files and modules) to your build. Python core .dll has size about 3.5Mb, for example.