importError: DLL load failed: The specified module could not be found

I am getting the following error when trying to use deepspeech, i am using deepspeech=0.6.1 python module on a windows 10 machine
any help is highly appreciated

Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\deepspeech.exe\__main__.py", line 5, in <module>
  File "c:\program files\python37\lib\site-packages\deepspeech\__init__.py", line 23, in <module>
    from deepspeech.impl import PrintVersions as printVersions
  File "c:\program files\python37\lib\site-packages\deepspeech\impl.py", line 13, in <module>
    from ._impl import *
ImportError: DLL load failed: The specified module could not be found.

Could you please verify if you might need to install the Redistribuable Runtime linked at https://deepspeech.readthedocs.io/en/v0.6.1/USING.html#using-a-pre-trained-model ?

I’ve installed the Redistribuable Visual C++ linked at the url, now i am getting the following error

Traceback (most recent call last):
  File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python36\Scripts\deepspeech.exe\__main__.py", line 5, in <module>
  File "c:\program files\python36\lib\site-packages\deepspeech\__init__.py", line 23, in <module>
    from deepspeech.impl import PrintVersions as printVersions
  File "c:\program files\python36\lib\site-packages\deepspeech\impl.py", line 13, in <module>
    from ._impl import *
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

sorry, i am running it on windows server os specifically Windows Server 2016 Datacenter, not on win 10

This is obviously something we don’t reproduce. Now, we also don’t have a lot of experience in debugging DLL on Windows, especially since I don’t know how to replicate LD_DEBUG=all linux’ behavior.

Could you check with depends.exe from sysinternals (or its newer fork) what it says on libdeepspeech.so that lives somewhere under c:\program files\python36\lib\site-packages\deepspeech\ ?

it’s missing quite a number of dlls(api-ms-win dlls, ext-ms-win dlls among a few others) and displays the following message:

Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

From my experience, api-ms-win stuff is harmless. Can you share a complete list / screenshot ?

I’ve not attached api-ms-win dlls, while rest are these





@Shak97 All those are coming from libdeepspeech.so ? Woo. We really need some help from some windows-expert on how to properly know what A dynamic link library (DLL) initialization routine failed. actually means …

@Shak97 Could you try with Windows C++ client and not the Python one, to ensure it’s not the python bindings ?

By any chance, is this 32 or 64 bits ?

its 64bit windows,
that’s a good idea, let me try with windows c++ client and see

@lissyx, i’ve tried deepspeech on windows 10 with the same settings as windows server and it works fine, also have matched missing dlls on both the machines and installed but there seems no change, could you provide me with link to windows c++ bindings please

They are on the Github release page, native_client.win.amd64.tar.xz or something like that

Do you mean Python bindings on Windows 10 ? So at least it’s working somewhere :-).
And it would be broken on Windows 2016 Datacenter ? Could it be that the naming of the library is an issue? Would renaming libdeepspeech.so to libdeepspeech.dll help there?

yes I meant python bindings on windows 10, renaming libdeepspeech.so to .dll resulted in the following error:

ImportError: DLL load failed: The specified module could not be found.

It’s really painful not to have an equivalent of LD_DEBUG=all, because there’s no way I can get more informations to help you …

Maybe try this? https://docs.microsoft.com/en-us/archive/blogs/junfeng/debugging-loadlibrary-failures

1 Like

I wish I had found that earlier.

I was reading the release notes and found that deepspeech support for windows server 2016 isn’t available

I wanted to know if its underway and would be available soon?

We should be able to run on anything starting from 2012, except if 2016 Datatcenter is really specific.

So getting to the root case here is really important to us.