lincolnloop / python-qrcode

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

Attribute error while launching the script #233

Closed xatarox closed 3 years ago

xatarox commented 3 years ago

import qrcode qr = qrcode.QRCode( version=1,` error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) qr.add_data('Some data') qr.make(fit=True)

img = qr.make_image(fill_color="black", back_color="white")

Traceback (most recent call last): File "C:\Users\vodax\Desktop\qrcode.py", line 1, in import qrcode File "C:\Users\vodax\Desktop\qrcode.py", line 2, in qr = qrcode.QRCode( AttributeError: partially initialized module 'qrcode' has no attribute 'QRCode' (most likely due to a circular import)

AndiEcker commented 3 years ago

rename the file C:\Users\vodax\Desktop\qrcode.py to something else like *qrcode*.py

Am Sa., 7. Aug. 2021 um 01:43 Uhr schrieb ATAR @.***>:

import qrcode qr = qrcode.QRCode( version=1,` error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) qr.add_data('Some data') qr.make(fit=True)

img = qr.make_image(fill_color="black", back_color="white")

Traceback (most recent call last): File "C:\Users\vodax\Desktop\qrcode.py", line 1, in import qrcode File "C:\Users\vodax\Desktop\qrcode.py", line 2, in qr = qrcode.QRCode( AttributeError: partially initialized module 'qrcode' has no attribute 'QRCode' (most likely due to a circular import)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lincolnloop/python-qrcode/issues/233, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4U63UMMTNHPN5NPN6ERQ3T3R6UNANCNFSM5BW2VEUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

xatarox commented 3 years ago

Thank you so much, what a stupid error of mine ! :)