2

I am trying to read QR codes using python3. I've found different solutions that depend on using qrtools.

I've also tried to download it using pip3 or apt-get. Then I've tried to install it from sources, tried to install zbar lib which it use to work, but I had multiple errors.

I've also tried to download and use it in python2, and it works successfully. And I want to ask, can I use it in python3, or it is impossible?

OldPeculier
  • 11,049
  • 13
  • 50
  • 76
Oleg Klimenko
  • 138
  • 1
  • 5
  • 20
  • 1
    Looking at qrtools docs it seems Python3 is supported. I suggest you file a bug report to the developers with a full error description included. – Hubert Grzeskowiak Nov 04 '15 at 10:35

2 Answers2

3

I found the answer to the question: zbar QR code reader in python 3 in google. There is an library that does this. Download the follow library in pip install. ZBar it self is only for python 2, but the zbarlight also for python 3.

https://pypi.python.org/pypi/zbarlight

edit: My answer would be usefull: How to use Python Pip install software, to pull packages from Github?

Community
  • 1
  • 1
Martijn van Wezel
  • 1,120
  • 14
  • 25
3

I have used pyzbar for reading my QR codes in Python3.

Installation:

brew install zbar
pip install pyqrcode
pip install pyzbar

And for reading the code:

from PIL import Image
from pyzbar.pyzbar import decode


result = decode(Image.open('sample.png'))
print(result)
taga
  • 3,537
  • 13
  • 53
  • 119