Works on Pycharm but nonexecutable (unable to find 'vosk')

61 Views Asked by At

Error message that shows when I try to execute .exe built file

I tried to make speech recognition program using vosk model

Everything worked on pycharm and I built exe file using command

pyinstaller -w -F --icon=vtt_Icon.ico -n "Video Searcher" main.py

However when I execute it, the message shows like the image above

(지정된 파일을 찾을 수 없습니다 means "Failed to open directory")

And the folder named MEI2327722 only appears when I execute exe file and disappears when close exe file.

Why this happens and how shoud I do?

enter image description here This image is my project file view

1

There are 1 best solutions below

0
JRK On

first find directory where folder named 'vosk' exist and edit

datas=[]

to

datas=[('vosk_directory', './vosk')]

at .spec file

then re-build exe file by not using .py but .spec for example

pyinstaller -F main.spec