How can I decode a qr code in python 3.6 in Anaconda 4.8.3 a Windows 10 Pro N 64 bit installation?
Most solutions require Pillow with zbar
. However, it appears zbar
is only available on 32bit
windows installations. Furthermore, pip install zbarlight
yields:
ERROR: No matching distribution found for pyzbarlight
To try and decode a qr code in python 3.6 in Anaconda 4.8.3 on a Windows 10 Pro N 64 bit device, I tried the following code:
# Set up virtual environment in Anaconda
# conda create --name test36 python=3.6
# conda activate test36
# Install pip in the `test36` environment:
# E:/ProgramData/Anaconda3/envs/test36/Scripts/pip install pyzbar
# Source: https://anaconda.org/anaconda/pillow
# conda install -c anaconda pillow
from pyzbar.pyzbar import decode
from PIL import Image
decode(Image.open('elbow.png'))
Which yields error:
OSError: [WinError 126] The specified module could not be found
Windows error message
If you see an ugly ImportError when importing pyzbar on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.
visit and read please here https://pypi.org/project/pyzbar/ or github homepage https://github.com/NaturalHistoryMuseum/pyzbar
I use Ubuntu for my purposes, so I cannot check this out, but in home project README they give information about ugly ImportError. If they talk about 64 bit installation, then pyazbar works on 64-bit Windows, please doublecheck that Visual C++ Redistributable Packages for Visual Studio 2013 is properly installed and other requirements are satisfied also.