Reputation: 461
I installed pylibdmtx. When I try to import this I get an error:
from pylibdmtx import pylibdmtx
ImportError: Unable to find dmtx shared library
I am using python 3.8.8 on mac.
Upvotes: -1
Views: 4859
Reputation: 1
Creating a symlink to the library as described in a similar issue for another library worked for me. I've adapted the solution for this answer:
$ mkdir ~/lib
$ ln -s $(brew --prefix libdmtx)/lib/libdmtx.dylib ~/lib/libdmtx.dylib
Upvotes: 0
Reputation: 1
My solution is to add path for dmtx library.
Check if dmtx is installed.
dmtxread --version
Find the location of dmtx (I installed the library using brew).
brew list dmtx-utils
or
find /opt/homebrew -name libdmtx\*
Now we need to locate the library location into ~/.bashrc or ~/.zshrc that is up the shell you are using. Insert a line of code into the file to point the location.
export DYLD_LIBRARY_PATH={your_dmtx_lib_location}:$DYLD_LIBRARY_PATH
Here is a full code of my .zshrc file
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/pete/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/pete/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/pete/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/pete/miniconda3/bin:$PATH"
fi
fi
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/libdmtx/0.7.7/lib:$DYLD_LIBRARY_PATH
unset __conda_setup
# <<< conda initialize <<<```
Upvotes: 0