TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

Couldn't load plugin 'tuflow' due to an error when calling its classFactory() method #15

Closed ZedeN1 closed 4 years ago

ZedeN1 commented 4 years ago

Plugin does not work on Linux

Error:

Couldn't load plugin 'tuflow' due to an error when calling its classFactory() method 

ModuleNotFoundError: No module named 'winreg' 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/__init__.py", line 71, in classFactory
    from .tuflowqgis_menu import tuflowqgis_menu
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_menu.py", line 38, in 
    from tuflow.ReFH2.refh2 import Refh2Dock
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/ReFH2/refh2.py", line 3, in 
    import winreg
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'winreg'

Python version: 3.7.5rc1 (default, Oct  8 2019, 16:47:45) [GCC 9.2.1 20191008] 
QGIS version: 3.10.0-A Coruña A Coruña, 6c816b4204 

Python Path:
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LAStools
/usr/share/qgis/python
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python37.zip
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/usr/local/lib/python3.7/dist-packages
/usr/lib/python3/dist-packages
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools/tools
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/crayfish/gui/../pyqtgraph-0.10.0-py2.py3-none-any.whl
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/ext_libs
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SwapVectorDirection
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/forms
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow
/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_tuviewer

System info:

pavel@blackwater:~/git/TauDEM/src/build$ neofetch 
            .-/+oossssoo+/-.               pavel@blackwater 
        `:+ssssssssssssssssss+:`           ---------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 19.10 x86_64 
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.3.0-19-generic 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 15 mins 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 4406 (dpkg), 13 (snap) 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.0.3 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Resolution: 1920x1080, 1920x1080 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   DE: KDE 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: KWin 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Theme: Breeze Dark [KDE], Breeze [GTK3] 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Icons: breeze-dark [KDE], breeze [GTK3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Terminal: konsole 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Terminal Font: Monospace 10 
  +sssssssssdmydMMMMMMMMddddyssssssss+     CPU: AMD A8-6600K APU (4) @ 3.900GHz 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      GPU: NVIDIA GeForce GT 730 
    .ossssssssssssssssssdMMMNysssso.       Memory: 3895MiB / 32125MiB 
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`                                   
            .-/+oossssoo+/-.

Can be fixed by commenting out the ReFH2 lines:

  1. tuflow/ReFH2/refh2.py", line 3
  2. tuflow/tuflowqgis_menu.py", line 38
TUFLOW-Support commented 4 years ago

Hi, thanks for the detailed post. This was indeed being caused by the refh2 tool which is a new feature. A check has been added that only loads the tool when using Windows.

Thanks