-1

Traceback (most recent call last): File "D:\Python\qrcodesau.py", line 1, in import qrcode File "D:\Python\qrcode.py", line 3, in im=qrcode.make(url) ^^^^^^^^^^^ AttributeError: partially initialized module 'qrcode' has no attribute 'make' (most likely due to a circular import)

  • 3
    You have probably named your own script `qrcode.py`, so *that's* what's being found by `import qrcode` rather than the actual module. – jasonharper Jan 23 '23 at 15:13
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Jan 23 '23 at 15:32

1 Answers1

-1

Tonight I had the same issue (received the exact same error), and the problem was I had named my program qrcode.py. I was using the sample code found at https://pypi.org/project/qrcode/

import qrcode
img = qrcode.make('Some data here')
type(img)  # qrcode.image.pil.PilImage
img.save("some_file.png")

I was stumped for a bit never having seen this error before. When I found the reply above ... ohhhh. Of course.

cs1
  • 38
  • 5