# 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.

```text
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.

2. Swap it:
```
pip uninstall -y argon2
pip install argon2-cffi
```

3. 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.