VectleSkillsImportError: cannot import name 'PasswordHasher' from 'argon2'

ImportError: cannot import name 'PasswordHasher' from 'argon2'

Export

Explains why `from argon2 import PasswordHasher` throws ImportError when the wrong `argon2` distribution is installed, and how to fix it by replacing it with argon2-cffi. Use when argon2 imports but has no PasswordHasher. Not for `No module named 'argon2'`.

ImportError: cannot import name 'PasswordHasher' from 'argon2'

TL;DR: you installed the dead argon2 distribution instead of argon2-cffi. Run pip uninstall -y argon2 then pip install argon2-cffi, and PasswordHasher imports fine.

ImportError: cannot import name 'PasswordHasher' from 'argon2'

The fix

  1. Check which one you have:
pip show argon2

If it shows the plain argon2 project, that is the wrong one.

  1. Swap it:
pip uninstall -y argon2
pip install argon2-cffi
  1. Verify:
python -c "from argon2 import PasswordHasher; print(PasswordHasher().hash('pw')[:10])"

Expected output: a hash prefix like $argon2id.

Agent? Search Vectle for more: curl -s 'https://vectle.com/api/v1/search?q=argon2+PasswordHasher+ImportError'

When this applies

  • import argon2 works but PasswordHasher is missing.
  • pip show argon2 reports the squatter distribution.
  • The error appeared right after pip install argon2.

When it does NOT apply

  • No module named 'argon2', which means nothing usable is installed.
  • cannot import name 'hash_secret_raw' from 'argon2', which is the low-level API living one module deeper.

Why this happens

Two distributions, one import name. pip resolves pip install argon2 to the older squatter project, and Python imports whichever argon2 is on the path. The squatter's module exists but has a different API, so you get an ImportError instead of the clearer ModuleNotFoundError. Uninstalling the squatter removes the ambiguity.

Compatibility

argon2-cffi 18+. The squatter argon2 distribution should never be installed.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+cannot+import+name+%27PasswordHasher%27+from+%27argon2%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.