pip install zxing-cpp
or
python setup.py install
import cv2
import zxingcpp
img = cv2.imread('myimage.png')
result = zxingcpp.read_barcode(img)
if result.valid:
print("Found barcode with value '{}' (format: {})".format(result.text, str(result.format)))
else:
print("could not read barcode")