PANOimagen / batch_hillshader

Plugin to generate a three light exposure hillshade (shaded relief by combining three light exposures)
GNU General Public License v3.0
16 stars 3 forks source link

Couldn't load plugin 'batch_hillshader-master' in QGIS on install #10

Closed josephricafort closed 2 years ago

josephricafort commented 2 years ago

Hi, I'm trying to install Batch Hillshader plugin in QGIS but experiencing this problem. I've been looking around for a solution to this:

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

ModuleNotFoundError: No module named 'gdal'

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/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/batch_hillshader-master/__init__.py", line 47, in classFactory
    from .batch_hillshader import batchHillshader
  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/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/batch_hillshader-master/batch_hillshader.py", line 45, in 
    from .batch_hillshader_dialog import batchHillshaderDialog
  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/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/batch_hillshader-master/batch_hillshader_dialog.py", line 53, in 
    from . import laspy_utils
  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/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/batch_hillshader-master/laspy_utils.py", line 40, in 
    from gdal import gdalconst
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'gdal'

Python version: 3.8.7 (default, Feb 10 2021, 09:04:08) [Clang 12.0.0 (clang-1200.0.32.29)] 
QGIS version: 3.22.6-Białowieża Białowieża, a9824e4192 

Python Path:
/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python
/Users/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/netCDF4-1.5.4-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/Rtree-0.9.4-py3.8.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/Fiona-1.8.13.post1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/snuggs-1.4.7-py3.8.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/opencv_contrib_python-4.3.0.36-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/matplotlib-3.3.0-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/patsy-0.5.1-py3.8.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/rasterio-1.1.5-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/click_plugins-1.1.1-py3.8.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/lib-dynload
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/GDAL-3.2.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/numpy-1.20.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/Pillow-7.2.0-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/scipy-1.5.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/geopandas-0.8.1-py3.8.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/statsmodels-0.11.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/pyproj-2.6.0-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/pandas-1.1.0-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python38.zip
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/numba-0.50.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/cftime-1.2.1-py3.8-macosx-10.13.0-x86_64.egg
/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.8/site-packages/affine-2.3.0-py3.8.egg
/Users/jricafort/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/jricafort/Desktop/Power Play graphics/hillshade
oguerrarea commented 2 years ago

Same issue, QGis LTR version 3.22.9.

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

ModuleNotFoundError: No module named 'gdal' Traceback (most recent call last): File "C:\PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python\qgis\utils.py", line 423, in _startPlugin plugins[packageName] = package.classFactory(iface) File "C:\Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\batch_hillshader-master__init__.py", line 47, in classFactory from .batch_hillshader import batchHillshader File "C:\PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\batch_hillshader-master\batch_hillshader.py", line 45, in from .batch_hillshader_dialog import batchHillshaderDialog File "C:\PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\batch_hillshader-master\batch_hillshader_dialog.py", line 53, in from . import laspy_utils File "C:\PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\batch_hillshader-master\laspy_utils.py", line 40, in from gdal import gdalconst File "C:\PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'gdal'

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.22.9-Białowieża Białowieża, a8e9e6fa

Python Path: C:/PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python C:/Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA~1/QGIS32~1.9/apps/qgis-ltr/./python/plugins C:\Program Files\QGIS 3.22.9\bin\python39.zip C:\PROGRA~1\QGIS32~1.9\apps\Python39\DLLs C:\PROGRA~1\QGIS32~1.9\apps\Python39\lib C:\Program Files\QGIS 3.22.9\bin C:\PROGRA~1\QGIS32~1.9\apps\Python39 C:\PROGRA~1\QGIS32~1.9\apps\Python39\lib\site-packages C:\PROGRA~1\QGIS32~1.9\apps\Python39\lib\site-packages\win32 C:\PROGRA~1\QGIS32~1.9\apps\Python39\lib\site-packages\win32\lib C:\PROGRA~1\QGIS32~1.9\apps\Python39\lib\site-packages\Pythonwin C:/Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users/oguer/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\joinmultiplelines C:\Users\oguer\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\kmltools\libs C:\Users\oguer\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms

czalaviek commented 2 years ago

I've prepared a little modification in code to run it again in QGIS and pulled into repo. I only needs merging.

JaviBecerra commented 2 years ago

This should be fixed on version 2.4.3 thanks to @czalaviek contribution. You can install it from the github repository or wait until 2.4.3 gets approved on QGIS official repository.