dongchangxi 1 month ago
parent
commit
50d27f1802
  1. 2
      script/factory_sliceing/build_exe.bat
  2. 11
      script/factory_sliceing/build_exe.spec

2
script/factory_sliceing/build_exe.bat

@ -31,6 +31,8 @@ if exist __pycache__ rmdir /s /q __pycache__ @@ -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 (

11
script/factory_sliceing/build_exe.spec

@ -17,7 +17,14 @@ a = Analysis( @@ -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( @@ -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, # 显示控制台窗口,因为程序需要打印日志

Loading…
Cancel
Save