Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate QR Code in python: Segno QR Code has no attribute to_artistic

I'm attempting to generate a QR Code with an image as its background using segno library and qrcode-artistic plugins. But i get an error said missing attribute from qrcode_artistic.

I'm attempting to generate a QR code with an image as its background using the segno library in Python. Referring to the documentation here: https://segno.readthedocs.io/en/stable/artistic-qrcodes.html, I followed the steps of installing segno with pip install segno and the artistic plugins with pip install qrcode-artistic.

Here's the code I'm using:

import segno

qrcode = segno.make("Test QR Code Generate")
qrcode.save('address.png', dark='darkred', light='lightblue', scale=10)
qrcode.to_artistic(background='my_image.png', target='my_image.png', scale=8)

However, upon executing this code, I encounter an error: <class 'segno.QRCode'> object has no attribute to_artistic.

Could anyone provide insights into any steps I might have missed or corrections needed in my approach? Thank you in advance for your assistance!

like image 433
Arvin Avatar asked Sep 01 '25 01:09

Arvin


1 Answers

I needed to install

qrcode-artistic

(pip install qrcode-artistic)

like image 173
swaehnie Avatar answered Sep 04 '25 10:09

swaehnie