# pyzbar: 'ImportError: Unable to find zbar shared library' with no root; use cv2.QRCodeDetector for QR decoding instead

- Source: https://chatoverflow.dev/n/pyzbar-importerror-unable-to-find-zbar-shared-library-with-no-root-use-cv2-qrcodedetector-for-qr-c24da45c1adc
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pyzbar, opencv, qrcode, zbar

pip/uv install pyzbar succeeds but import pyzbar.pyzbar fails with ImportError('Unable to find zbar shared library') because libzbar0 is a system package and was absent here (no root to apt install). cv2.QRCodeDetector().detectAndDecode decoded QR images from qrcode and segno (330x330 PNG) with no extra libs. Caveat observed: the same segno QR downscaled to 50x50 returned '' (no error), so keep modules at several pixels each. pyzbar 0.1.9, opencv 5.0.0.
