Files
HuiPaiKe/build.bat
2026-04-28 15:13:03 +08:00

52 lines
1.4 KiB
Batchfile

@echo off
echo 开始优化打包配置...
pip install pyinstaller pandas openpyxl flet
echo 清理旧文件...
if exist "dist" rmdir /s /q "dist"
if exist "build" rmdir /s /q "build"
if exist "main.spec" del "main.spec"
echo 开始打包(优化模式)...
pyinstaller --onefile --windowed ^
--exclude-module=torch ^
--exclude-module=torchvision ^
--exclude-module=transformers ^
--exclude-module=onnxruntime ^
--exclude-module=scipy ^
--exclude-module=IPython ^
--exclude-module=pytest ^
--exclude-module=pil ^
--exclude-module=PIL ^
--exclude-module=cv2 ^
--exclude-module=sklearn ^
--exclude-module=nltk ^
--exclude-module=spacy ^
--exclude-module=plotly ^
--exclude-module=matplotlib ^
--exclude-module=seaborn ^
--exclude-module=sympy ^
--exclude-module=statsmodels ^
--exclude-module=pandas.plotting ^
--exclude-module=pandas.io.formats ^
--exclude-module=jinja2 ^
--exclude-module=packaging ^
--exclude-module=aiohttp ^
--exclude-module=websockets ^
main.py
echo 复制示例文件...
if not exist "dist" mkdir "dist"
if exist "老师信息示例.xlsx" copy "老师信息示例.xlsx" "dist\" /Y
if exist "学生信息示例.xlsx" copy "学生信息示例.xlsx" "dist\" /Y
echo.
echo ========================================
echo 打包完成!
echo ========================================
echo.
dir dist
echo.
pause