Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot importing libvosk.dll #1549

Open
duran004 opened this issue Apr 1, 2024 · 6 comments
Open

cannot importing libvosk.dll #1549

duran004 opened this issue Apr 1, 2024 · 6 comments

Comments

@duran004
Copy link

duran004 commented Apr 1, 2024

I can't load the vosk model and it doesn't give me an error. I did some editing to find the error.

def open_dll():
        try:
            dlldir = os.path.abspath(os.path.dirname(__file__))
            if sys.platform == "win32":
                # We want to load dependencies too
                print("importing vosk dll...1")
                os.environ["PATH"] = dlldir + os.pathsep + os.environ["PATH"]
                print("importing vosk dll...2")
                if hasattr(os, "add_dll_directory"):
                    print("importing vosk dll...3")
                    os.add_dll_directory(dlldir)
                    print("importing vosk dll...4")
                    print(os.path.join(dlldir, "libvosk.dll"))
                    e=_ffi.dlopen(os.path.join(dlldir, "libvosk.dll"))
                    print("importing vosk dll...5")
                return e
            elif sys.platform == "linux":
                return _ffi.dlopen(os.path.join(dlldir, "libvosk.so"))
            elif sys.platform == "darwin":
                return _ffi.dlopen(os.path.join(dlldir, "libvosk.dyld"))
            else:
                raise TypeError("Unsupported platform")
        except Exception as e:
            print(f"An error occurred: {e}")

the output is like this

importing vosk dll...1
importing vosk dll...2
importing vosk dll...3
importing vosk dll...4
C:\Users\dcyilmaz\AppData\Local\Programs\Python\Python312\Lib\site-packages\vosk\libvosk.dll

When I check the dll file, it exists in the directory
image

@nshmyrev
Copy link
Collaborator

nshmyrev commented Apr 1, 2024

You can check with dependencywalker to see what is missing for the dll.

@duran004
Copy link
Author

duran004 commented Apr 2, 2024

You can check with dependencywalker to see what is missing for the dll.

When I try to open libvosk.dll with the library https://github.com/lucasg/Dependencies , I think it says they are missing. I don't quite understand.
image

@duran004
Copy link
Author

duran004 commented Apr 3, 2024

Any ideas?

@nshmyrev
Copy link
Collaborator

nshmyrev commented Apr 3, 2024

Those ext ones are expected and not critical. You need to show whole window, not a small part.

@duran004
Copy link
Author

duran004 commented Apr 3, 2024

ofcourse
image

image
image
image
image
image
image

@nshmyrev
Copy link
Collaborator

nshmyrev commented Apr 3, 2024

Maybe you have 32-bit python and you installed 64-bit package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants