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

Could not find module 'libdmtx-32.dll' #76

Open
SablyTv opened this issue Jan 20, 2022 · 2 comments
Open

Could not find module 'libdmtx-32.dll' #76

SablyTv opened this issue Jan 20, 2022 · 2 comments

Comments

@SablyTv
Copy link

SablyTv commented Jan 20, 2022

Im trying to import decode from pylibdmtx by:

from pylibdmtx.pylibdmtx import decode

but get this error:

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\dmtx_library.py", line 38, in load
libdmtx = cdll.LoadLibrary(fname)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\ctypes_init_.py", line 451, in LoadLibrary
return self.dlltype(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\ctypes_init
.py", line 373, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libdmtx-32.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "api.py", line 14, in
from pylibdmtx.pylibdmtx import decode
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\pylibdmtx.py", line 10, in
from .wrapper import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\wrapper.py", line 70, in
dmtxVersion = libdmtx_function('dmtxVersion', c_char_p)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\wrapper.py", line 58, in libdmtx_function
return prototype((fname, load_libdmtx()))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\wrapper.py", line 39, in load_libdmtx
LIBDMTX = dmtx_library.load()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\dmtx_library.py", line 40, in load
libdmtx = cdll.LoadLibrary(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\ctypes_init
.py", line 451, in LoadLibrary
return self.dlltype(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\ctypes_init
.py", line 373, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylibdmtx\libdmtx-32.dll' (or one of its dependencies). Try using the full path with constructor syntax.

@baodvu
Copy link

baodvu commented Feb 10, 2022

+1 on this issue

https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python

Basically even though the file is there, on python 3.8+ the dll directory has to be declared.

@baodvu
Copy link

baodvu commented Feb 23, 2022

I resolved this issue by following this:

Windows error message
If you see an ugly ImportError when importing pylibdmtx on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.

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

No branches or pull requests

2 participants