@echo off echo 开始打包数学学习系统... echo. REM 检查是否安装了PyInstaller python -c "import PyInstaller" 2>nul if errorlevel 1 ( echo 错误:未找到PyInstaller,请先安装:pip install pyinstaller pause exit /b 1 ) REM 清理之前的构建文件 if exist "build" rmdir /s /q "build" if exist "dist" rmdir /s /q "dist" if exist "__pycache__" rmdir /s /q "__pycache__" echo 清理完成,开始打包... echo. REM 执行打包命令 pyinstaller --clean MathStudySystem.spec if errorlevel 1 ( echo 打包失败!请检查错误信息。 pause exit /b 1 ) echo. echo 打包完成!可执行文件位于 dist 目录中。 echo. pause