How to convert DeepSpeech to exe in windows 10

I am trying to convert DeepSpeech using Pyinstaller:

Steps to reproduce this error:

Download this file: https://drive.google.com/file/d/1AQx_zbXbbKHQLb2d5Z1xgIHpyPJsuo1m/view?usp=sharing

Install “Pyinstaller”, then run this command: "pyinstaller -y -F C:/Users/Kamal Chhirang/Downloads/New folder (22)/deep_speech_client.py

After it finishes converting the py file to exe. A folder named dist will be created. Go to “dist” folder, and then run “deep_speech_client.exe” using CMD.

I am getting this error:

Traceback (most recent call last):
  File "deep_speech_client.py", line 18, in <module>
  File "c:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\deepspeech\__init__.py", line 14, in <module>
  File "c:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\deepspeech\impl.py", line 13, in <module>
ImportError: DLL load failed: The specified module could not be found.
[36904] Failed to execute script deep_speech_client

I am using Python 3.7

Why are you doing this ? There’s libdeepspeech.so that you can directly use …

I added some custom features to the script like:

Fetching audio from videos, and then converting the audio to 16-bit, 16 kHz, mono audio. Also taking multiple inputs at once from a CSV files etc.

I will take a look at libdeepspeech.so, thank you.

@kamalchhirang BTW, there’s absolutely no error reported in your original post, I don’t see how we can help you …

Oh sorry. It is not DeepSpeech error, probably from the side of “pyinstaller”. But I think modifying DeepSpeech code can fix this.

I am adding more details about the error.

Added more information. Please let me know, If I missed anything, thanks a lot.

This is unreadable. Please use proper code formatting.

You should never ever touch that file …

Please use vanilla python

You need to check what DLL is missing … I suspect it’s unable to find libdeepspeech.so ? But who knows …

The python program runs perfectly. But I am unable to convert the python file to exe. Pyinstaller works with Anaconda3 perfectly. But I will try vanilla python also.

I think Pyinstaller cannot import modules at runtime. So I modified the impl.py file. But when I run the exe file, it gives me the above error.

I want to distribute this exe file to other pc’s without installing Python or anything. I formatted the error and other things. I hope it’s more clear now.

I already told you, it’s the Import DLL part that is important. I can’t help you more, you need to figure out why it arises. Likely it’s not able to find libdeepspeech.so, but without more context, can’t help.