[osgeo4w-dev] [osgeo4w] #761: qgis-dev: ImportError: DLL load failed while importing _gdal

OSGeo4W trac_osgeo4w at osgeo.org
Mon Sep 26 00:47:15 PDT 2022


#761: qgis-dev: ImportError: DLL load failed while importing _gdal
------------------------+---------------------------
Reporter:  andreaerdna  |      Owner:  osgeo4w-dev@…
    Type:  defect       |     Status:  new
Priority:  critical     |  Component:  Package
 Version:               |   Keywords:
------------------------+---------------------------
 The GDAL processing algorithms (e.g. GDAL Merge) with the latest QGIS
 3.27.0-Master (qgis-dev 3.27.0-312-c6eca784ad-1 and gdal-dev
 3.6.0-117-ebe17cf8fc-1) fail with the following error:


 {{{
 Traceback (most recent call last):
 File "C:\OSFB9F~1\apps\gdal-dev\lib\site-packages\osgeo\__init__.py", line
 30, in swig_import_helper
 return importlib.import_module(mname)
 File "C:\OSFB9F~1\apps\Python39\lib\importlib\__init__.py", line 127, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
 File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
 File "<frozen importlib._bootstrap>", line 565, in module_from_spec
 File "<frozen importlib._bootstrap_external>", line 1173, in create_module
 File "<frozen importlib._bootstrap>", line 228, in
 _call_with_frames_removed
 ImportError: DLL load failed while importing _gdal: Impossibile trovare il
 modulo specificato.

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
 File "C:\OSFB9F~1\apps\gdal-dev\Scripts\gdal_merge.py", line 5, in
 <module>
 from osgeo.gdal import deprecation_warn
 File "C:\OSFB9F~1\apps\gdal-dev\lib\site-packages\osgeo\__init__.py", line
 46, in <module>
 _gdal = swig_import_helper()
 File "C:\OSFB9F~1\apps\gdal-dev\lib\site-packages\osgeo\__init__.py", line
 42, in swig_import_helper
 raise ImportError(traceback_string + '\n' + msg)
 ImportError: Traceback (most recent call last):
 File "C:\OSFB9F~1\apps\gdal-dev\lib\site-packages\osgeo\__init__.py", line
 30, in swig_import_helper
 return importlib.import_module(mname)
 File "C:\OSFB9F~1\apps\Python39\lib\importlib\__init__.py", line 127, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
 File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
 File "<frozen importlib._bootstrap>", line 565, in module_from_spec
 File "<frozen importlib._bootstrap_external>", line 1173, in create_module
 File "<frozen importlib._bootstrap>", line 228, in
 _call_with_frames_removed
 ImportError: DLL load failed while importing _gdal: Impossibile trovare il
 modulo specificato.

 On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
 If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES
 environment variable
 to feed the PATH into os.add_dll_directory().
 Process returned error code 1
 }}}

 QGIS 3.22.11 and 3.26.3 in the same OSGeo4W installation are not affected.
-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/761>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list