Python Forum
Python can't find a library which is definitely there!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python can't find a library which is definitely there!
#1
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!
Reply
#2
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]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find I2C library in Python Joni_Engr 1 1,776 Oct-08-2021, 04:06 PM
Last Post: Larz60+
  ImportError: Can not find the shared library: libhdfs3.so aupres 1 4,041 Oct-18-2020, 06:57 AM
Last Post: bowlofred
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,793 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020