pyinstaller打包

1. 在cmd里安装pyintall  ; win+R,输入 cmd,

pip install pyinstaller

2.在要打包的文件的文件夹上shift+右键,点击“在此处打开powershell窗口”

3.输入打包命令  

# pyinstaller -F -w "TimerMainSimple.py"   # 无黑窗
# pyinstaller -F "TimerMainSimple.py" # 有黑窗
# pyinstaller  -w "TimerMainSimple.py"     # 无黑窗文件夹

4.在窗口中可看到exe的生成路径

 5.我好了,你的就不知道了哈哈

 视频教程


总结的常见错误

错误:Failed to execute script pyi_rth_pkgres

解决方案:(不知所以就成功了)

1.卸载ANNOUNCE(可以先不卸载试试)

2.重装pyinstaller

pip uninstall pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

 3. 删除上次打包残余文件与文件夹

 4.重新打包

pyinstaller -F "hello world.py"      有黑窗
pyinstaller -F -w "TimeMainXdd.py"    无黑窗

 就这样成功了,不明觉厉~  参考:木十的博客

 错误:Failed to execute script

PyQt5 Pyinstaller Failed to execute script部分解决方法_小锋学长的博客-CSDN博客
https://blog.csdn.net/sxf1061700625/article/details/99713613

转载仅为学习,不会商用。
欢迎转载原创,附文链接。
原文地址:https://www.cnblogs.com/xdd1997/p/13251527.html