python - PyQGis 与 QWebEngineView 崩溃
问题描述
我安装了 QGIS 3.16.3-Hannover 和 Qt 5.11.2 和 64 位 Windows 10。在另外两台计算机上,我也在类似的条件下安装了它。
我正在将 PyQgis 用于 Qgis 的独立应用程序,我认为 PyQgis 中有些东西不能很好地工作,因为我不能使用 QWebEngineView 和 QWebKit 是的。
我的症状是:
1.-如果在安装了Qgis的QtDesigner中,我在设计中添加了QWebEngineView小部件,程序直接crash并停止运行。
2.- 如果在独立应用程序中我启动 QWebEngineView 它会给我一个错误:
代码:
from qgis.PyQt.QtWidgets import QWidget, QApplication, QMainWindow, QFileDialog
from PyQt5.QtWebEngineWidgets import QWebEngineView
import sys
class temp (QWebEngineView):
def __init __ (self):
super () .__ init __ ()
if __name__ == '__main__':
# We create the instance of the created class and show the window on the screen
app = QApplication (sys.argv)
win = temp ()
win.show ()
sys.exit (app.exec_ ())
它给出的错误是:
Qt WebEngine ICU data not found at C: /OSGeo4W64/apps/Qt5/resources.Trying parent directory ...
Qt WebEngine ICU data not found at C: / OSGeo4W64 / apps / Qt5. Trying application directory ...
Qt WebEngine ICU data not found at C: / OSGeo4W64 / apps / Python37. Trying fallback directory ... The application MAY NOT work. Installed
Qt WebEngine locales directory not found at location C: / OSGeo4W64 / apps / Qt5 / translationss \ qtwebengine_locales. Trying application directory ...
Qt WebEngine locales directory not found at location C: / OSGeo4W64 / apps / Python37 \ qtwebengine_locales. Trying fallback directory ... Translations MAY NOT not be correct.
[0205 / 214808.373: ERROR: icu_util.cc (179)] Invalid file descriptor to
ICU data received.
[0205 / 214808.491: FATAL: icu_util.cc (311)] Check failed: result. Backtrace:
我看过这个链接:
https://issues.qgis.org/issues/18155 3年前看来这个错误无法解决...
然后与其他:
https://forum.qt.io/topic/70457/qt-5-7-qtwebenginewidgets-not-working-on-linux/3
我的安装中似乎缺少以下文件夹,其中包括:资源、qtwebengine_locales、...
我已经使用 OsGeo4W 设置卸载了 qwebengine。然后我重新安装了它。
我看到QGis使用5.10.1版本,我尝试通过pip install安装它,但它告诉我只有5.12的版本。
我认为它一定是 QWebEngineView 没有与 Qgis 正确安装。因为如果我将它与 python38 或 python 39 的安装一起使用,那么它是否有效。
解决方案
推荐阅读
- c - 如何从我自己的 C UNIX shell 中删除僵尸进程
- javascript - 我们如何将 prevState 数据存储到变量中,以便如果在 api 调用期间发生任何错误,我们可以恢复发生的更改
- r - 找不到函数“describe”(进行描述性统计分析)
- java - 无法在 Firebase 数据库中上传 GeoFire 位置
- vb.net - 有没有办法让我编写一个程序来显示用户输入的任何四个数字的所有可能组合
- selenium - 如何使用 XPath 选择器选择范围内的属性?
- angular - 通过 Angular 6 和 .NET Core 从服务器下载文件
- javascript - 如何在不从函数声明变量的情况下返回解构对象?
- javascript - 将对象数组转换为所需格式
- python - 如何将一维列表转换为具有一些列数的二维列表?