2

I am not able to install any plugin. Packages qtwebkit and qt5-qtwebkit are installed on my machine.

Below is an example for the error ocurring:

Couldn't load plugin 'go2streetview' due to an error when calling its classFactory() method 
ImportError: cannot import name 'QtWebKit' 
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/qgis/utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/florian/.local/share/QGIS/QGIS3/profiles/default/python/plugins/go2streetview/__init__.py", line 34, in classFactory
    from .go2streetview import go2streetview
  File "/usr/lib64/python3.6/site-packages/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/florian/.local/share/QGIS/QGIS3/profiles/default/python/plugins/go2streetview/go2streetview.py", line 23, in 
    from PyQt5 import Qt, QtCore, QtWidgets, QtGui, QtWebKit, QtWebKitWidgets, QtXml, QtNetwork, uic
ImportError: cannot import name 'QtWebKit'


Python version: 3.6.5 (default, Mar 29 2018, 18:20:46) [GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] 
QGIS version: 3.0.3-Girona Girona, exported 

Python Path:
/usr/share/qgis/python
~/.local/share/QGIS/QGIS3/profiles/default/python
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib64/python36.zip
/usr/lib64/python3.6
/usr/lib64/python3.6/lib-dynload
/usr/lib64/python3.6/site-packages
/usr/lib/python3.6/site-packages
~/.local/share/QGIS/QGIS3/profiles/default/python

What might be the problem here?

1
  • Did you find an answer already?
    – Michael
    Commented Jul 19, 2018 at 3:09

1 Answer 1

1

Plugins need to be updated otherwise they won't work in QGIS3.

According to https://gis.stackexchange.com/a/292614/187:

QtWebKit is deprecated in Qt >= 5.5. It has been replaced by QtWebEngineCore. (https://doc.qt.io/qt-5.11/whatsnew55.html#deprecated-functionality More infos: https://forum.qt.io/topic/55504/anyone-knows-the-future-of-qt-webkit & http://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html ).

2
  • 1
    That's not correct - qt upstream reversed the decision and it's supported again.
    – ndawson
    Commented Mar 2, 2019 at 10:32
  • @ndawson great, so this plugin should work correctly (can't check since I don't have an API key)
    – underdark
    Commented Mar 2, 2019 at 13:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.