0

I installed QGIS plug-in "AVHYAS is an open source Python 3 tool plugged in QGIS",and installed required libraries however while trying to use some function, I got the following error. The link of the plug-in: https://sites.google.com/view/avhyas-sac-isro/home I updated matplotlib hover it did not help me.

The error

An error has occurred while executing Python code:

ModuleNotFoundError: No module named 'matplotlib.backends.backend_qt4agg' 
Traceback (most recent call last):
  File "C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HxTools\HxTools.py", line 1927, in doDeepLearning
    from .doDeepLearning import HxToolsDialog
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HxTools\doDeepLearning.py", line 21, in 
    os.path.join(pluginPath, 'HxTools/ui', 'dialogDeepLearning.ui'))
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\PyQt\uic\__init__.py", line 36, in __loadUiType
    return __PyQtLoadUiType(*args, **kwargs)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\PyQt5\uic\__init__.py", line 201, in loadUiType
    exec(code_string.getvalue(), ui_globals)
  File "", line 477, in 
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HxTools\ui\qmatplotlibwidget2.py", line 42, in 
    from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'matplotlib.backends.backend_qt4agg'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.14.16-Pi Pi, df27394552 

Python Path:
C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python
C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.14\apps\Python37
C:\PROGRA~1\QGIS3~1.14\apps\Python37\Scripts
C:\Program Files\QGIS 3.14\bin\python37.zip
C:\PROGRA~1\QGIS3~1.14\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib
C:\Program Files\QGIS 3.14\bin
C:\Users\musta\AppData\Roaming\Python\Python37\site-packages
C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\Pythonwin
C:/Users/musta/AppData/Roaming/QGIS/QGIS3\profiles\default/python
2

1 Answer 1

1

For me on Windows I just changed:

from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas

to:

from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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