lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.27k stars 662 forks source link

Unable to create svg qrcode with version > 7.4 #310

Closed obriand1 closed 1 year ago

obriand1 commented 1 year ago

Line : QRimg = QRcode.make_image( image_factory=qrcode.image.svg.SvgImage, module_drawer=SquareModuleDrawer(), ) generate the following error message: File "/home/obriand/.pyenv/versions/qrcode/lib/python3.11/site-packages/PIL/ImageDraw.py", line 62, in init im.load() ^^^^^^^ AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'load'

When I reinstall version 7.3.1, everything is ok

akx commented 1 year ago

SquareModuleDrawer() is meant to be used with PIL. Use SvgSquareDrawer() for SVGs.