Zbar libraries

I am trying to deploy an app that reads/decodes QR codes. I cannot get around or find a solution for Streamlit being unable to locate/read zbar libraries. This is the traceback:

Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/script_runner.py", line 430, in _run_script
    exec(code, module.__dict__)
  File "/app/team-paper-plates/app1.py", line 14, in <module>
    from functions import load_contract, pin_artwork, pin_artwork, make_qr_quote, get_image_from_database, total_token_supply, vin_verification, qr_decoder, register_car,connect_to_db, get_qr_info
  File "/app/team-paper-plates/functions.py", line 12, in <module>
    from pyzbar.pyzbar import decode
  File "/home/appuser/venv/lib/python3.9/site-packages/pyzbar/pyzbar.py", line 7, in <module>
    from .wrapper import (
  File "/home/appuser/venv/lib/python3.9/site-packages/pyzbar/wrapper.py", line 139, in <module>
    zbar_version = zbar_function(
  File "/home/appuser/venv/lib/python3.9/site-packages/pyzbar/wrapper.py", line 136, in zbar_function
    return prototype((fname, load_libzbar()))
  File "/home/appuser/venv/lib/python3.9/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "/home/appuser/venv/lib/python3.9/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

Packages.txt:
ffmpeg
libsm6
libxext6
freeglut3-dev
libgtk2.0-dev
libzbar0
zbar-tools

Requirements.txt:
qrcode
Pillow
streamlit
web3
pyzbar

any fixes? Thank you, in advance.

Hi @SpeedsMach5 -

Can you share the repo that demonstrates this behavior? Your traceback does not share much info about what the problem might be.

Best,
Randy

Hi,
I am also facing the same issue but I was able to solve this issue in Heroku with the help of the following aptfile
libgl1
libzbar0
libzbar-dev
libsm6
libxrender1
libfontconfig1
libice6

And for Streamlit create packages.txt in your project repo and add the above following.

I hope this helps