sagban / Zbar-barcode-reader-python-javascript

A barcode reader which detects and read barcode and Qr codes from the live streaming webcam, laptop cam and mobile phones (back and front both) camera.
31 stars 45 forks source link

raise ImportError('Unable to find zbar shared library') ImportError: Unable to find zbar shared library #3

Open sangramrajekakade opened 5 years ago

sangramrajekakade commented 5 years ago

here is my traceback

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fbeb2b0e840>
Traceback (most recent call last):
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
    self.check(display_num_errors=True)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/management/base.py", line 364, in check
    include_deployment_checks=include_deployment_checks,
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/management/base.py", line 351, in _run_checks
    return checks.run_checks(**kwargs)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/checks/registry.py", line 73, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 397, in check
    for pattern in self.url_patterns:
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 536, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
    return import_module(self.urlconf_name)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/barcode/urls.py", line 24, in <module>
    path(r'',include('bar.urls')),
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/bar/urls.py", line 2, in <module>
    from . import views
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/bar/views.py", line 3, in <module>
    from . import barCode
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/bar/barCode.py", line 2, in <module>
    import pyzbar.pyzbar as pyzbar
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/pyzbar/pyzbar.py", line 7, in <module>
    from .wrapper import (
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/pyzbar/wrapper.py", line 148, in <module>
    c_uint_p,    # minor
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/pyzbar/wrapper.py", line 141, in zbar_function
    return prototype((fname, load_libzbar()))
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/site-packages/pyzbar/wrapper.py", line 120, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "/home/panacea/Downloads/Zbar-barcode-reader-python-javascript-master/venv/lib/python3.5/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
sagban commented 5 years ago

https://github.com/NaturalHistoryMuseum/pyzbar/issues/37

Please check out this issue to solve this problem. Actually, this is a very common problem arises while installing pyzbar dependency.

If you still facing problems then please let me know.

Jaredslocker21 commented 1 year ago

I am facing this error

File "scanner.py", line 5, in import pyzbar.pyzbar as pyzbar File "/workspace/.pip-modules/lib/python3.8/site-packages/pyzbar/pyzbar.py", line 7, in from .wrapper import ( File "/workspace/.pip-modules/lib/python3.8/site-packages/pyzbar/wrapper.py", line 151, in zbar_version = zbar_function( File "/workspace/.pip-modules/lib/python3.8/site-packages/pyzbar/wrapper.py", line 148, in zbar_function return prototype((fname, load_libzbar())) File "/workspace/.pip-modules/lib/python3.8/site-packages/pyzbar/wrapper.py", line 127, in load_libzbar libzbar, dependencies = zbar_library.load() File "/workspace/.pip-modules/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 gitpod /workspace/qr-scanner-python-build (main) $