ImportError: Unable to find dmtx shared library
Noboru-Chen opened this issue ยท 6 comments
When I used pylibdmtx to do data matrix decode I got below error message.Is there anyone can help me on this issue. Thanks.
---> How can I create "dmtx shared library"?
from pylibdmtx.pylibdmtx import decode
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pylibdmtx/pylibdmtx.py", line 10, in
from .wrapper import (
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pylibdmtx/wrapper.py", line 70, in
_dmtxVersion = libdmtx_function('dmtxVersion', c_char_p)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pylibdmtx/wrapper.py", line 58, in libdmtx_function
return prototype((fname, load_libdmtx()))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pylibdmtx/wrapper.py", line 39, in load_libdmtx
LIBDMTX = dmtx_library.load()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pylibdmtx/dmtx_library.py", line 47, in load
raise ImportError('Unable to find dmtx shared library')
ImportError: Unable to find dmtx shared library
I am also facing the same error
the problem is that python wrapper can't load libdmtx itself (either it is not installed, or just python can't find it (maybe, it looks in wrong paths)).
Unfortunately, I've no MacOS-powered hardware, so I can't provide you with exactly ways to test and fix this misbehaviour, but anyway I'd bet it is not issue of libdtmx, but OS-related.
I'd faced the same issue and I fixed it by using both pip and apt-get to install libdmtx:
pip3 install pylibdmtx
sudo apt-get install libdmtx0a
The installation of libsdmtx didn't fix the problem for me
can you be a bit more specific about your problem, and how did you try to fix it, please?
I'm running python 3.11 on macOS 13.1 - and was having the same issue.
After some debugging I fixed this by adding a symlink to one of the locations it was searching for the library
sudo ln -s /opt/homebrew/lib/libdmtx.dylib /usr/local/lib/