thangqd / HCMGIS

HCMGIS Plugin for QGIS
GNU General Public License v3.0
33 stars 9 forks source link

ModuleNotFoundError: No module named '_datadir' #11

Closed iyan31 closed 9 months ago

iyan31 commented 4 years ago

Hello, I stumble upon an error when installing this plugin on macOS Catalina (10.15.4) on QGIS 3.10. Below is the error message:

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

ModuleNotFoundError: No module named '_datadir'.

PedroVenancio commented 3 years ago

I'm getting this error now with QGIS 3.18, installed from new OSGeo4W testing installer that uses Python 3.9:

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

ImportError: DLL load failed while importing _datadir: Impossível localizar o módulo especificado. 
Traceback (most recent call last):
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 335, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/PedroVenancio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\__init__.py", line 11, in classFactory
    from .hcmgis_menu import hcmgis_menu
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/PedroVenancio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\hcmgis_menu.py", line 11, in 
    from .hcmgis_dialogs import *
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/PedroVenancio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\hcmgis_dialogs.py", line 22, in 
    from owslib.wfs import WebFeatureService
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\owslib\wfs.py", line 16, in 
    from .feature import wfs100, wfs110, wfs200
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\owslib\feature\wfs100.py", line 33, in 
    import pyproj
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\pyproj\__init__.py", line 50, in 
    from pyproj import _datadir
  File "C:/OSGeo4W/apps/qgis-rel-dev/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed while importing _datadir: Impossível localizar o módulo especificado.
NMItools commented 3 years ago

I confirm the issue with 3.18 from a new OSGEO4W installer:

2021-03-19T21:51:40     CRITICAL    Traceback (most recent call last):
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 335, in _startPlugin
              plugins[packageName] = package.classFactory(iface)
              File "C:/Users/Nebojsa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\__init__.py", line 11, in classFactory
              from .hcmgis_menu import hcmgis_menu
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:/Users/Nebojsa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\hcmgis_menu.py", line 11, in 
              from .hcmgis_dialogs import *
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:/Users/Nebojsa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HCMGIS\hcmgis_dialogs.py", line 22, in 
              from owslib.wfs import WebFeatureService
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:\OSGeo4W\apps\Python39\lib\site-packages\owslib\wfs.py", line 16, in 
              from .feature import wfs100, wfs110, wfs200
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:\OSGeo4W\apps\Python39\lib\site-packages\owslib\feature\wfs100.py", line 33, in 
              import pyproj
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:\OSGeo4W\apps\Python39\lib\site-packages\pyproj\__init__.py", line 50, in 
              from pyproj import _datadir
              File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 798, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
             ImportError: DLL load failed while importing _datadir: The specified module could not be found.