Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: Unable to find zbar shared library #37

Closed
SmithPeng opened this issue Aug 13, 2018 · 12 comments
Closed

ImportError: Unable to find zbar shared library #37

SmithPeng opened this issue Aug 13, 2018 · 12 comments

Comments

@SmithPeng
Copy link

after pip install pyzbar, I've test it in python3.4 and python3.6

import pyzbar
from pyzbar.pyzbar import decode
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.6/site-packages/pyzbar/pyzbar.py", line 7, in
from .wrapper import (
File "/usr/lib/python3.6/site-packages/pyzbar/wrapper.py", line 148, in
c_uint_p, # minor
File "/usr/lib/python3.6/site-packages/pyzbar/wrapper.py", line 141, in zbar_function
return prototype((fname, load_libzbar()))
File "/usr/lib/python3.6/site-packages/pyzbar/wrapper.py", line 120, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "/usr/lib/python3.6/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

what's the problem?!

@SmithPeng
Copy link
Author

I've found the problem
before install pyzbar, zbar should be installed, because pyzbar ' No dependencies, other than the zbar library itself '.

yum install zbar

is OK

@3Mcolab
Copy link

3Mcolab commented Nov 14, 2018

Still error exists no zbar found while installing in AWS:
yum install zbar
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 2.4 kB 00:00:00
amzn2extra-docker | 1.3 kB 00:00:00
amzn2extra-nginx1.12 | 1.3 kB 00:00:00
(1/3): amzn2-core/2/x86_64/group_gz | 2.4 kB 00:00:00
(2/3): amzn2-core/2/x86_64/updateinfo | 56 kB 00:00:00
(3/3): amzn2-core/2/x86_64/primary_db | 23 MB 00:00:00
No package zbar available.
Error: Nothing to do

@quicklizard99
Copy link
Member

Will track AWS behaviour at #40

@navneetsn18
Copy link

https://pypi.org/project/pyzbar/ This document worked for me. Hope this helps..

@SandeepKumarRudhravaram7215

can anyone please tell me what is the solution for mac m1? for me the below error is getting.

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

These are thing i installed.

Mac OS X:

brew install zbar

Install this Python wrapper; use the second form to install dependencies of the command-line scripts:

pip install pyzbar

@marrtinol
Copy link

@SandeepKumarRudhravaram7215

This worked for me. Try for yourself.

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

From npinchot/zbar#3 (comment)

@akellehe
Copy link

akellehe commented Jun 2, 2022

@CarlKing5019 thanks, this works for me! Very strange that pyzbar would look in ~/lib instead of oh, i dunno, $(brew --prefix zbar)/lib... hopefully the developers will patch this soon.

@Vadym-Kononenko-SWI
Copy link

@CarlKing5019 thanks! It works for me too!

@AliLmassoudi
Copy link

@CarlKing5019 Thanks man ,it works

@smanikantam
Copy link

@CarlKing5019 thanks! it worked. even chatGPT could't solved that 😂.

@tadaissee
Copy link

Solution :

1 : !sudo apt-get install libzbar0

2: !pip install pyzbar

3: !pip install pyzbar[scripts]

it works 100%

@HarikrishnanK9
Copy link

@tadaissee Thank You.Worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests