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!
(base) ➜ GetQzonehistory git:(main) brew install zbar
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Running brew update --auto-update
...
Warning: You are using macOS 15.
We do not provide support for this pre-release version.
It is expected behaviour that some formulae will fail to build in this pre-release version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
Error: unknown or unsupported macOS version: :dunno
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