PyQT5打包后报错:Could not find QtWebEngineProcess.exe

在pyqt5的开发中,如果引用了WebEngine后,通过pyinstaller经常会遇到报错:Could not found QtWebEngineProcess.exe,根据报错提示,一步一步剖析问题。

现在使用的版本:

PyQt5==5.15.4
PyQtWebEngine==5.15.4
  • Could not found QtWebEngineProcess.exe

我们可以在打包生成的target文件中,找到PyQt5的对应依赖文件PyQt5>Qt>bin>QtWebEngineProcess.exe,将EXE文件拷贝到与主程序目录下同级目录,则可以解决第一个问题,但也会出现第二个报错

  • Qt WebEngine resources not found
Qt WebEngine resources not found at E:/Project/XXX/target/XXX_desktop/PyQt5/Qt5/resources. Trying parent directory...
Qt WebEngine resources not found at E:/Project/XXX_client/target/XXX_desktop/PyQt5/Qt5. Trying application directory...
Qt WebEngine resources not found at E:/Project/XXX_client/target/XXX_desktop. Trying fallback directory... The application MAY NOT work.
Installed Qt WebEngine locales directory not found at location E:/Project/XXX_client/target/XXX_desktop/PyQt5/Qt5/translations\qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location E:/Project/XXX_client/target/XXX_desktop\qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
[0615/103056.192:ERROR:icu_util.cc(251)] Couldn't mmap icu data file

仔细观察报错,发现WebEngine未能在PyQt5/Qt5目录下找到对应的resources这一系列依赖文件。
通过查找文件发现,resources这一系列文件均在PyQt5/Qt的目录下,尝试将Qt目录下的全部文件夹拷贝到PyQt5/Qt5与bin同级目录下,再次启动应用

问题解决!!

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值