使用pyinstaller发布exe程序,执行后报"failed to execute script main"错误

使用console输出后发现,问题出在exit(app.exec_())

参考文章https://stackoverflow.com/questions/30144893/name-exit-is-not-defined-in-python将
exit(app.exec_())
改为
sys.exit(app.exec_())
即可
本文介绍如何解决使用PyInstaller将Python程序打包成exe后出现的failedtoexecutescriptmain错误。通过将exit(app.exec_())修改为sys.exit(app.exec_()),可以成功避免这一问题。
使用pyinstaller发布exe程序,执行后报"failed to execute script main"错误

使用console输出后发现,问题出在exit(app.exec_())

参考文章https://stackoverflow.com/questions/30144893/name-exit-is-not-defined-in-python将
exit(app.exec_())
改为
sys.exit(app.exec_())
即可
519
8648

被折叠的 条评论
为什么被折叠?