Python Forum

Full Version: Python can't find a library which is definitely there!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
EDIT: I managed to get it working with:
Quote:sudo apt-get install libzbar0

Don't know what I have in my .local folder, must be something for Windoze. SOLVED!!

I need to use pyzbar to read QR codes.

I am using this new laptop,with a new install of Ubuntu 20.04.

I installed pyzbar with pip3 install pyzbar, no problem. There was a warning:

Quote:WARNING: The script read_zbar is installed in '/home/pedro/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

So I added that to PATH

I am getting this error when I try:

Quote:import pyzbar.pyzbar as pyzbar

Quote:115, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "/home/pedro/.local/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

The file zbar_library.py is definitely in the above path. I checked.

The owner of zbar_library.py is me, I have rw permissions.

The file is not executable, but none of the files in the path: "/home/pedro/.local/lib/python3.8/site-packages/pyzbar/" are executable.

Should they be??

Any ideas why this file is not "seen"??

Everything has been difficult on this new laptop! On my old laptop, using Ubuntu 18.04, this all works fine, no problems!
pyzbar 0.1.8
Quote:The zbar DLLs are included with the Windows Python wheels.
On other operating systems, you will need to install the zbar shared library.
sudo apt-get install libzbar0

pip install pyzbar
pip install pyzbar[scripts]