阳光很暖 (@JiangJiangYo) 在 pyinstaller 打包 python 脚本 遇到一个很烦的问题 求救 中发帖
下面是bat启动脚本 使用 pyinstaller 执行打包
REM 请在激活 venv 后运行本脚本,或在脚本中先激活 venv(如果需要)
REM 假设你已经激活 venv: .\venv\Scripts\activate
REM 清理旧的构建目录(可选)
rd /s /q dist
rd /s /q build
del /q IDBI_GUI.spec
REM 使用 PyInstaller 打包为 onedir(保留外部脚本文件)
REM 注意 windows 下 --add-data 的分隔符是 ';'
pyinstaller --noconfirm --clean --onedir --windowed ^
--name IDBI_GUI ^
--add-data "IdbiBank.py;." ^
--add-data "config.txt;." ^
-...