Python——ImportError: Unable to find zbar shared library

30
四月
2021

from pyzbar import pyzbar 异常报错,pip install pyzbar 也不成功

Traceback (most recent call last):
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 162, in init_process
    super().init_process()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/python3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/repos/2_1575_20210429221304/exsel_app.py", line 11, in <module>
    from exsel_app_ext import db, init_api_doc, init_aliyun_open_api, init_tencent_open_api, init_jd_union, \
  File "/home/repos/2_1575_20210429221304/exsel_app_ext.py", line 17, in <module>
    from service.sms.open_api import AliOpenapiAgent, TencentOpenapiAgent
  File "/home/repos/2_1575_20210429221304/service/sms/open_api.py", line 9, in <module>
    from utils.utils import LoggerFactory
  File "/home/repos/2_1575_20210429221304/utils/utils.py", line 23, in <module>
    from pyzbar import pyzbar
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/pyzbar/pyzbar.py", line 7, in <module>
    from .wrapper import (
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/pyzbar/wrapper.py", line 143, in <module>
    c_uint_p,    # minor
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/pyzbar/wrapper.py", line 136, in zbar_function
    return prototype((fname, load_libzbar()))
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "/opt/yyjxpython/yyjxpython/lib/python3.7/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

解决办法:

1.yum install zbar-devel

2.pip install pyzbar

 

TAG

网友评论

共有访客发表了评论
请登录后再发布评论,和谐社会,请文明发言,谢谢合作! 立即登录 注册会员