Open Daniel-ccx opened 3 years ago
I have the same problem. Have you solved it
Same here
I have the same problem. Have you solved it?
I have saved it . you should install brew to ‘/usr/local/bin/brew’. you can see blog : https://www.jianshu.com/p/a4b9f490e54c
https://www.jianshu.com/p/f183063fd13b
https://blog.csdn.net/luofuyin9555/article/details/114363585
Hi folks. I don't have an m1 Mac to test this with. I'm not the main Python zbar library person - I just forked it a while back to add some fixes I needed. I'm probably not able to help on this one. You might have a better result posting a support issue at http://zbar.sourceforge.net/support.html
Hey, guys. I solved this problem. You just needed to use python interpreter installed with brew. For example: use "/opt/homebrew/Cellar/python@3.9/3.9.9/bin/python3" instead your current.
@loookashow Do you mind detailing a bit more how you got the build process to use the python interpreter from Homebrew? What did you update to use "/opt/homebrew/Cellar/python@3.9/3.9.9/bin/python3"? This could help other folks with the same issue.
I'll be getting an M1 Mac soon. Will do my best to help once I have one. However, as a note, I've stopped compiling this library directly on my Mac. I only currently use it inside a Docker container on my Mac so that I don't need to deal with as many issues like this.
Hey, guys. I solved this problem. You just needed to use python interpreter installed with brew. For example: use "/opt/homebrew/Cellar/python@3.9/3.9.9/bin/python3" instead your current.
Worked for me
This solution solved this problem for any Python interpreters.
$ mkdir ~/lib
$ ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib
This solution solved this problem for any Python interpreters.
$ mkdir ~/lib
$ ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib
Thank you! I have tried many ways, and this worked for me finally.
I had to use TensorFlow in the same repo hence was limited with options of interpreter and had to stick with miniforge.
Issue I faced was it was always reading from x86 path not from arm64 version i installed.
Use
arch -arm64 brew install zbar
will create a folder in /usr/local/Cellar/zbar/0.23.90_2
brew install zbar
will create a folder in /usr/local/Cellar/zbar/0.23.90_1
Copy /opt/homebrew/Cellar/zbar/0.23.90_2
and put it in /usr/local/Cellar/zbar/
delete /usr/local/Cellar/zbar/0.23.90_1
change the name of 0.23.90_2 to 0.23.90_1
This solution solved this problem for any Python interpreters.
$ mkdir ~/lib
$ ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib
Just want to add that there is a non-invasive solution to this problem as well. The underlying issue is that on apple silicon, homebrew installs to /opt/homebrew
instead of /usr/local
by default, and so libraries installed by homebrew aren't on the default search path, but you can modify the python's search path by setting the DYLD_LIBRARY_PATH
environment variable. For example:
$ export DYLD_LIBRARY_PATH="$(brew --prefix)/lib:$DYLD_LIBRARY_PATH"
$ python -c "import pyzbar.pyzbar"
This solution solved this problem for any Python interpreters.
$ mkdir ~/lib
$ ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib
This worked for me. thank you :)
This solution solved this problem for any Python interpreters.
$ mkdir ~/lib
$ ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib
perfect!
Then :
File "/opt/anaconda3/lib/python3.8/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar libzbar, dependencies = zbar_library.load() File "/opt/anaconda3/lib/python3.8/site-packages/pyzbar/zbar_library.py", line 65, in load raise ImportError('Unable to find zbar shared library') ImportError: Unable to find zbar shared library
/opt/anaconda3/bin/../lib/libzbar.dylib, 6): no suitable image found /opt/anaconda3/bin/../lib/libzbar.dylib: mach-o, but wrong architecture