pyinstaller打包报错 Failed to execute script ‘xxx’ due to unhandled exception:input():lost sys.stdin
pyinstaller打包exe文件,打开exe报错 Failed to execute script ‘xxx’ due to unhandled exception:input():lost sys.stdin Failed to obtain/convert traceback!
是因为在打包的时候使用了参数 -w,即无控制台窗口模式,导致需要命令行输入时无法执行并报错。
解决办法,使用打包命令: pyinstaller -F xxx.py,或写成 pyinstaller -F -c xxx.py(-c参数使用控制台子系统执行,默认方式)。