hynek / argon2-cffi

Secure Password Hashes for Python
https://argon2-cffi.readthedocs.io/
MIT License
549 stars 47 forks source link

ImportError: cannot import name 'PasswordHasher' from partially initialized module 'argon2' #161

Closed mpp-lewisz closed 9 months ago

mpp-lewisz commented 9 months ago

(env) lewis@laptop hmac % python argon2.py
Traceback (most recent call last): File "/Users/lewis/Downloads/hmac/argon2.py", line 1, in from argon2 import PasswordHasher File "/Users/lewis/Downloads/hmac/argon2.py", line 1, in from argon2 import PasswordHasher ImportError: cannot import name 'PasswordHasher' from partially initialized module 'argon2' (most likely due to a circular import) (/Users/lewis/Downloads/hmac/argon2.py) (env) lewis@laptop hmac % pip list Package Version


argon2-cffi 23.1.0 argon2-cffi-bindings 21.2.0 cffi 1.16.0 pip 23.3.2 pycparser 2.21 setuptools 58.0.4

hynek commented 9 months ago

Rename your script to not be argon2.py. Your script is trying to import from itself.