iona5 / coordinator

A QGIS plugin: Capture, transform and use coordinates
2 stars 2 forks source link

ImportError at QGIS startup on macOS #19

Open jfvilleforceix opened 2 months ago

jfvilleforceix commented 2 months ago

Hello, I installed the plugin on macOS and on some startups (not all) I get this error message :

ImportError: cannot import name 'QWebView' from 'PyQt5.Qt' (/Users/jfv/.local/lib/python3.9/site-packages/PyQt5/Qt.abi3.so) 
Traceback (most recent call last):
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/jfv/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/coordinator/__init__.py", line 35, in classFactory
    from .coordinator import Coordinator
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jfv/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/coordinator/coordinator.py", line 38, in 
    from .coordinator_dockwidget import CoordinatorDockWidget
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jfv/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/coordinator/coordinator_dockwidget.py", line 31, in 
    from PyQt5.Qt import pyqtSignal, QLocale, QApplication, QDoubleValidator, QIntValidator,\
ImportError: cannot import name 'QWebView' from 'PyQt5.Qt' (/Users/jfv/.local/lib/python3.9/site-packages/PyQt5/Qt.abi3.so)

A suggestion to solve this error is to replace the import with : from PyQt5.QtWebKitWidgets import QWebView as suggested here : https://issues.qgis.org/issues/19275

iona5 commented 2 months ago

thanks for the report,

I'll look into it, but as far as i remember i specifically did it this way because of some other issues. It will probably not be enough to just replace an import.