在使用pyinstaller打包py文件生成可执行文件exe出现闪退问题,解决方法:
在需要打包的py文件中的主函数最后一行添加如下代码:
python2: raw_input('please input any key to exit')
python3: input('please input any key to exit')
然后重新打包,生成exe文件
脑机接口社区 博主文章分类:Python技术点滴 ©著作权
在使用pyinstaller打包py文件生成可执行文件exe出现闪退问题,解决方法:
在需要打包的py文件中的主函数最后一行添加如下代码:
python2: raw_input('please input any key to exit')
python3: input('please input any key to exit')
然后重新打包,生成exe文件
上一篇:在世界第二届半机械人奥运会上,瘫痪驾驶员在Cybathlon BCI竞赛中争夺金牌
下一篇:[pyinstaller] “RuntimeError: No metadata path found for distribution ‘greenlet‘
python脚本打包为exe,并下载图片。
脚本写完后,可以正常地在Visual Studio Code下跑出结果,符合预期。用pyinstaller打包为单个exe文件的过程看上去很“完美”,但是封装后的exe文件每次执行都闪退,错误信息如下:
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M