在mac下,需要 -w 打包,否则终端直接提示:
Cannot find QtWebEngineProcess
加 -w 打包后,打开app,但是网页无法渲染,因为是加了 -w 打包,没法直接查看错误日志。可点开你的App -> 显示包内容 -> Conntets -> MacOS -> app名称,直接双击这个脚本,然后会打开终端。查看到错误:
dyld: Library not loaded: @rpath/QtQmlModels.framework/Versions/5/QtQmlModels
Referenced from: .../testbrowser_webengine.app/Contents/MacOS/PyQt5/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
Reason: image not found
原因:https://github.com/pyinstaller/pyinstaller/issues/4631
解决思路: pyinstaller 升级到最新版本4.0再打包解决。
另外:在windows系统下,如果遇到 Cannot find QtWebEngineProcess,检查自己的app目录是否含有中文,如果有改成全英文,也完美解决。
本文介绍了使用pyinstaller在Mac和Windows环境下打包包含QtWebEngine的应用程序时遇到的问题及解决方案。在Mac下需解决CannotfindQtWebEngineProcess错误,并确保正确加载QtQmlModels框架;在Windows下则需注意应用目录不能包含中文。
544

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



