Import pyzbar error

hey, trying to use
from pyzbar import pyzbar
on my code, but getting an exception.
Looked it up and ended up adding
libzbar-cffi
to the requirements file, but now i get a different issue:

ERROR: Failed building wheel for libzbar-cffi

when trying to run with the new addition to the requirements, anyone know what can i do to fix the original problem? the error with from pyzbar import pyzbar is:

File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
    exec(code, module.__dict__)File "/app/streamlit-example/streamlit_app.py", line 14, in <module>
    from pyzbar import pyzbarFile "/home/appuser/venv/lib/python3.7/site-packages/pyzbar/pyzbar.py", line 7, in <module>
    from .wrapper import (File "/home/appuser/venv/lib/python3.7/site-packages/pyzbar/wrapper.py", line 155, in <module>
    c_uint_p,    # minorFile "/home/appuser/venv/lib/python3.7/site-packages/pyzbar/wrapper.py", line 148, in zbar_function
    return prototype((fname, load_libzbar()))File "/home/appuser/venv/lib/python3.7/site-packages/pyzbar/wrapper.py", line 127, in load_libzbar
    libzbar, dependencies = zbar_library.load()File "/home/appuser/venv/lib/python3.7/site-packages/pyzbar/zbar_library.py", line 65, in load
    raise ImportError('Unable to find zbar shared library')

Hi @avia, welcome to the Streamlit community!

Per the pzbar documentation, it appears the right library is libzbar0 for the packages.txt file. Can you try that instead?

Best,
Randy

Hey @randyzwitch , thanks!

I never realized what is that packages.txt file, is it streamlit related? would love some directions on how to use it

It’s part of the Streamlit Cloud specification for apps that need system-level dependencies:

Best,
Randy