Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

该项目如何优化打包 #22

Open
BleethNie opened this issue Feb 22, 2024 · 0 comments
Open

该项目如何优化打包 #22

BleethNie opened this issue Feb 22, 2024 · 0 comments

Comments

@BleethNie
Copy link

BleethNie commented Feb 22, 2024

我在其它issue
#12
#21
中看到使用nuitka进行打包,试了一下nuitka打包,有如下问题:

1.打包大小有300MB+,但是作者[Releases]处提供的包大小只有54M(使用PyInstaller可以减小体积吗)
直接删除掉打包后的qt6webenginecore.dll和opengl32sw.dll文件,体积减小到165M,是否还有其它优化空间
image

2.nuitka打包执行main.exe后有一个黑窗,参考文章 https://zhuanlan.zhihu.com/p/584899817 尝试了下去掉黑窗的办法

  • 代码中有 subprocess等执行cmd的操作,需要加上creationflags=subprocess.CREATE_NO_WINDOW参数,如下,同时增加打包参数 --windows-disable-console
 result = subprocess.run(git_cmd, shell=True, check=True,
                            stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,creationflags=subprocess.CREATE_NO_WINDOW)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant