打包
主程序为:registration_HM.py
所关联的UI程序:registrationGUI.py
修改UI外观的程序为 designer.exe 应该已经在这台电脑上安装好,但在用designer
修改并保存前请先查看registrationGUI.py里的一些注释。修改后registration.ui文件内容会随之更新,
然后运行指令更新registrationGUI.py即可:
pyuic5 -o registrationGUI.py registration.ui
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
安装pyinstaller工具包后
打包成exe基本指令:pyinstaller -F registration_HM.py
pyinstaller -F -w --collect-submodules=pydicom registration_HM.py
把comps文件夹放到registration_HM下
把Std_Space.cfg也放到该目录下
打包过程中可能莫名缺少一些的库而失败,主要的解决办法是
修改registration_HM.spec 的部分参数,网上很多类似教程,然后用指令:
pyinstaller -F registration_HM.spec 重新打包
pyinstaller -F asd.py
pyinstaller -F qwe.py
文章来源:python打包exe_名难取aaa的博客-CSDN博客_mac python 打包exe
总结命令
Pyinstaller -F setup.py 打包exe
Pyinstaller -F -w setup.py 不带控制台的打包
Pyinstaller -F -i xx.ico setup.py 打包指定exe图标打包
平常我们只需要这三个就好了https://www.bilibili.com/read/cv6309114/ 出处:bilibili