简体   繁体   English

(MacBook M1):raise ImportError('Unable to find zbar shared library') ImportError: Unable to find zbar shared library

[英](MacBook M1):raise ImportError('Unable to find zbar shared library') ImportError: Unable to find zbar shared library

Mac OS X : Mac OS X:

brew install zbar 

Install this Python wrapper;安装这个 Python 包装器; use the second form to install dependencies of the command-line scripts:使用第二种形式安装命令行脚本的依赖项:

pip install pyzbar

I tried these steps but i'm still getting the bellow error我尝试了这些步骤,但我仍然收到以下错误

File "/Users/something/opt/anaconda3/envs/muenv/lib/python3.8/site-packages/pyzbar/wrapper.py", line 136, in zbar_function
    return prototype((fname, load_libzbar()))
  File "/Users/something/opt/anaconda3/envs/muenv/lib/python3.8/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "/Users/something/opt/anaconda3/envs/muenv/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

This worked for me.这对我有用。 Have a try.试试。

mkdir ~/lib
ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib

From https://stackoverflow.com/a/71904987/14882853来自https://stackoverflow.com/a/71904987/14882853

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM