pyinstaller打包运行报错failed to execute script main

pyqt5写完win32 应用程序后,经过pyinstaller打包成单个文件,运行弹出错误提示框:failed to execute script main

pycharm中pyinstaller打包参数:

Program:C:\Python\Python35\Scripts\pyinstaller.exe

Parameters: -w -F $FileName$

Working directory: $FileDir$


分析:

经google,发现pyinstaller 有--hidden-import 选项

             --hidden-import MODULENAME, --hiddenimport MODULENAME

                        Name an import not visible in the code of the

                        script(s). This option can be used multiple times.


解决:

打包时加上 --hidden-import=queue

即Parameters配置修改为:

Parameters:--hidden-import=queue -w -F $FileName$

猜你喜欢

转载自blog.csdn.net/zhifeng172/article/details/72907113