enricofer / go2streetview

22 stars 22 forks source link

Can't install in QGIS 3.2: ImportError: cannot import name 'QtWebKit' #38

Closed reinvantveer closed 5 years ago

reinvantveer commented 5 years ago

Message:

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/lib/python3/dist-packages/qgis/utils.py", line 337, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python/plugins/go2streetview/__init__.py", line 34, in classFactory
    from .go2streetview import go2streetview
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 665, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/reinv/.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.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] 
QGIS version: 3.2.0-Bonn Bonn, bc43194 

Python Path:
/usr/share/qgis/python
/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python
/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
/home/reinv/.local/lib/python3.5/site-packages
/usr/local/lib/python3.5/dist-packages
/usr/lib/python3/dist-packages
/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python
.
/home/reinv/.local/lib/python3.5/site-packages/IPython/extensions
/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python/plugins/go2streetview
/home/reinv/.local/share/QGIS/QGIS3/profiles/default/python/plugins/go2streetview/res
reinvantveer commented 5 years ago

Some pointers: https://stackoverflow.com/questions/37876987/cannot-import-qtwebkitwidgets-in-pyqt5#37877273 and https://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html

enricofer commented 5 years ago

Are you under Ubuntu? did you try sudo apt-get install python3-pyqt5.qtwebkit ? have a look to: https://github.com/enricofer/go2mapillary/issues/11

reinvantveer commented 5 years ago

Thanks, that did it! I neglected to search in the closed issues.