DASFEnMAPbox / scipy.special import error / DLL laod failed

Issue #499 closed
Benjamin Jakimow created an issue

Some apps that use scipy, like DASFEnMAPbox, raises ImportError:DLL load failed

Traceback (most recent call last):
  File "C:\PROGRA~1\OSGeo4W\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:/PROGRA~1/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\OSGeo4W\apps\Python37\lib\site-packages\scipy\special\__init__.py", line 634, in <module>
    from . import _ufuncs
  File "C:/PROGRA~1/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

How to reproduce:

from qgis.core import Qgis
import scipy
# print versions
Qgis.version()
scipy.version.version

# does this cause an error?
import scipy.special

observed in:

QGIS Version Scipy Version Error?
3.14.15-Pi (OSGeo4W) 1.4.1. yes
3.14.1 (conda-forge, Ubuntu 18) 1.4.1. no
3.12. (conda-forge, windows) 1.3.1. no
3.10. ? ?

Comments (13)

  1. Matthias Wocher

    Hi,

    Since I unfortunately had a HDD crash, I was reinstalling QGIS from scratch. Installing 3.12., all enmapbox apps are working. With 3.14.15-Pi installation the following errors occur:

    EnMAPBoxApplication error(s): DASFEnMAPbox:

    OSError:[WinError 126] Das angegebene Modul wurde nicht gefunden
    Traceback:
    File "C:/Users/m.wocher/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\applications.py", line 279, in addApplicationFolder
    appModule = importlib.import_module(appPkgName)
    File "D:\OSGeo4W64\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "", line 1006, in _gcd_import
    File "", line 983, in _find_and_load
    File "", line 967, in _find_and_load_unlocked
    File "", line 677, in _load_unlocked
    File "", line 728, in exec_module
    File "", line 219, in _call_with_frames_removed
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\DASFEnMAPbox\__init__.py", line 2, in
    from DASFEnMAPbox.processingalgorithm import DASFretrievalAlgorithm
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\DASFEnMAPbox\processingalgorithm.py", line 3, in
    from .core import DASF_retrieval
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\DASFEnMAPbox\core.py", line 8, in
    from scipy import interpolate, stats
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\scipy\__init__.py", line 136, in
    from . import _distributor_init
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\scipy\_distributor_init.py", line 61, in
    WinDLL(os.path.abspath(filename))
    File "D:\OSGeo4W64\apps\Python37\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)

    ensomap:

    TypeError:create_target_machine() got an unexpected keyword argument 'jitdebug'
    Traceback:
    File "C:/Users/m.wocher/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\applications.py", line 290, in addApplicationFolder
    apps = factory(self.mEnMAPBox)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap\__init__.py", line 35, in enmapboxApplicationFactory
    from ensomap.enmapboxintegration import EnSoMAP
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap\enmapboxintegration.py", line 32, in
    import hys
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap\hys\__init__.py", line 26, in
    from .tools import *
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "C:\Users\m.wocher\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap\hys\tools.py", line 5, in
    from numba import jit, float32, void, intc, int64, int32
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\__init__.py", line 196, in
    import numba.typed
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\typed\__init__.py", line 3, in
    from .typeddict import Dict
    File "D:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\typed\typeddict.py", line 19, in
    @njit
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\decorators.py", line 238, in njit
    return jit(*args, **kws)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\decorators.py", line 175, in jit
    return wrapper(pyfunc)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\decorators.py", line 191, in wrapper

    • *dispatcher_args)

    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\dispatcher.py", line 650, in __init__
    self.targetctx = self.targetdescr.target_context
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\registry.py", line 50, in target_context
    return self._toplevel_target_context
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\utils.py", line 390, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\registry.py", line 34, in _toplevel_target_context
    return cpu.CPUContext(self.typing_context)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\base.py", line 260, in __init__
    self.init()
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock
    return func(*args, **kwargs)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\cpu.py", line 51, in init
    self._internal_codegen = codegen.JITCPUCodegen("numba.exec")
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\codegen.py", line 628, in __init__
    self._init(self._llvm_module)
    File "D:\OSGeo4W64\apps\Python37\lib\site-packages\numba\targets\codegen.py", line 637, in _init
    tm = target.create_target_machine(**tm_options)

  2. Benjamin Jakimow reporter

    The OSGeo4W installer allows to downgrade to 3.14.1, which solved the problems in my case.

  3. Log in to comment