module 'argon2' has no attribute 'low_level'

Issue #99 new
deckar01
created an issue
  • passlib: 1.7.1
  • macOS: 10.12.6
  • python: 3.6.3
  • backend: argon2-0.1.10

Once I uninstalled argon2 the error message changed and suggested using argon2_cffi. Using argon2_cffi-16.3.0 resolved the issue.

If the argon2 pip package is not supported, then passlib should probably provide a better error message and direct users to argon2_cffi.

Traceback (most recent call last):
  File "/Users/jared/src/ctf-api/tests/base_case.py", line 32, in setUpClass
    'last_name': 'Powers',
  File "/Users/jared/src/ctf-api/tests/base_case.py", line 67, in create_user
    user = User(data)
  File "<string>", line 4, in __init__
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 414, in _initialize_instance
    manager.dispatch.init_failure(self, args, kwargs)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 411, in _initialize_instance
    return manager.original_init(*mixed[1:], **kwargs)
  File "/Users/jared/src/ctf-api/ctf_api/models/user/user.py", line 34, in __init__
    self.password_hash = argon2.hash(password)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/handlers/argon2.py", line 520, in hash
    cls._stub_requires_backend()
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/utils/handlers.py", line 2221, in _stub_requires_backend
    cls.set_backend()
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/utils/handlers.py", line 2130, in set_backend
    return cls.set_backend(name, dryrun=dryrun)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/utils/handlers.py", line 2155, in set_backend
    cls._set_backend(name, dryrun)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/utils/handlers.py", line 2278, in _set_backend
    super(SubclassBackendMixin, cls)._set_backend(name, dryrun)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/utils/handlers.py", line 2191, in _set_backend
    ok = loader(**kwds)
  File "/Users/jared/src/ctf-api/env/lib/python3.6/site-packages/passlib/handlers/argon2.py", line 565, in _load_backend_mixin
    max_version = _argon2_cffi.low_level.ARGON2_VERSION
AttributeError: module 'argon2' has no attribute 'low_level'

Comments (1)

  1. Log in to comment