vosk-api
vosk-api copied to clipboard
Vosk does not work with pyinstaller
Hi, I could make a script that works as a py file, but when I try to run pyinstaller to get an exe of the file I get that error, about the vosk lib, someone knows what can I do?
I dont know how to solve that, it is my first touch with python I'm kind lost
How did you package the exe binary exactly
How did you package the exe binary exactly
Thank you for your time, I just installed pyinstaller with pip install pyinstaller
and ran that command
pyinstaller --noconsole --debug=all chess.py
I did not done any extra config
Hello. I had the same problem. The solution that worked for me was to put all the files from site-packages\vosk folder to dist\app\vosk folder.
Thanks @RaisHibi, with that fix I cannot use onefile option rigth? But I will test It
For now I using cb_freeze
The same problem. I obtain this message when try to run exe file.
Traceback (most recent call last):
File "Vega.py", line 10, in <module>
from vosk import Model, KaldiRecognizer
File "C:\Users\Alex\AppData\Local\Temp\embedded.zm51h3af.zip\shibokensupport\__feature__.py", line 142, in _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 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "vosk\__init__.py", line 21, in <module>
File "vosk\__init__.py", line 12, in open_dll
File "os.py", line 1111, in add_dll_directory
FileNotFoundError: [WinError 2] The specified file cannot be found: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\_MEI126762\\vosk'
[920] Failed to execute script Vega
I used pyinstaller.
Thanks @RaisHibi, with that fix I cannot use onefile option rigth? But I will test It
For now I using cb_freeze
I think you can if you add site-packages\vosk folder as data in your .spec file
Thanks @RaisHibi, with that fix I cannot use onefile option rigth? But I will test It For now I using cb_freeze
I think you can if you add site-packages\vosk folder as data in your .spec file
I did the copy/paste with the vosk folder and worked greate with pyinstaller thanks!!
But I tried to put it into datas on specs file and received the same error that @AlexUser97 received, someone knows what can we do?
It worked in my case. Make sure you put the folder into datas correctly. Here's an example: datas = [('...\venv\Lib\site-packages\vosk', './vosk')] So you first mention the site-packages\vosk folder and then say where it is located in your application folder. Onefile option creates only .exe, but when you launch it, every file needed is copyed to your temp folder. And it looks the same as dist folder when you choose onedir option. So everything should work in both cases.
Thanks for your help these days @RaisHibi it worked fine now, thank you so much
Hello everyone, I have the same problem as @AlexUser97 . I tried to solve as wrote @RaisHibi , but nothing came of it, I assume that I did not specify the paths correctly in datas, can anyone help me?
I have the same problem as @AlexUser97
Which problem exactly. What is the error message.
У меня та же проблема, что и у @ AlexUser97
Какая именно проблема. Что за сообщение об ошибке.
Such an error on startup
I had the same error and fixed by copying directory site-packages/vosk
into distributed dir.
The same problem. I obtain this message when try to run exe file.
Traceback (most recent call last): File "Vega.py", line 10, in <module> from vosk import Model, KaldiRecognizer File "C:\Users\Alex\AppData\Local\Temp\embedded.zm51h3af.zip\shibokensupport\__feature__.py", line 142, in _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 680, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module File "vosk\__init__.py", line 21, in <module> File "vosk\__init__.py", line 12, in open_dll File "os.py", line 1111, in add_dll_directory FileNotFoundError: [WinError 2] The specified file cannot be found: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\_MEI126762\\vosk' [920] Failed to execute script Vega
I used pyinstaller.
pyinstaller --noconsole --onefile --collect-all vosk test.py
worked for me. None of the other methods worked sadly.