From 50d27f1802e8760e4244515c022bde682425137d Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Mon, 24 Nov 2025 18:33:39 +0800 Subject: [PATCH] 1 --- script/factory_sliceing/build_exe.bat | 2 ++ script/factory_sliceing/build_exe.spec | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/script/factory_sliceing/build_exe.bat b/script/factory_sliceing/build_exe.bat index 293f390..ec0c979 100644 --- a/script/factory_sliceing/build_exe.bat +++ b/script/factory_sliceing/build_exe.bat @@ -31,6 +31,8 @@ if exist __pycache__ rmdir /s /q __pycache__ echo. echo [3/4] 使用 PyInstaller 打包... +echo 注意:由于包含 open3d、numpy、cryptography 等大型库,打包可能需要 5-15 分钟,请耐心等待... +echo. python -m PyInstaller build_exe.spec if errorlevel 1 ( diff --git a/script/factory_sliceing/build_exe.spec b/script/factory_sliceing/build_exe.spec index 97636c6..b23c907 100644 --- a/script/factory_sliceing/build_exe.spec +++ b/script/factory_sliceing/build_exe.spec @@ -17,7 +17,14 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=[ + 'matplotlib', # 如果不需要绘图功能 + 'PIL', # 如果不需要图像处理 + 'tkinter', # GUI 库,通常不需要 + 'pytest', # 测试框架 + 'IPython', # 交互式 Python + 'jupyter', # Jupyter 相关 + ], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, @@ -37,7 +44,7 @@ exe = EXE( debug=False, bootloader_ignore_signals=False, strip=False, - upx=True, + upx=False, # 关闭 UPX 压缩以加快打包速度 upx_exclude=[], runtime_tmpdir=None, console=True, # 显示控制台窗口,因为程序需要打印日志