# ModuleNotFoundError: No module named 'jose'

TL;DR: the distribution is called python-jose, not jose. Run `pip install python-jose` (and uninstall the unrelated `jose` package if you installed it by mistake).

```text
ModuleNotFoundError: No module named 'jose'
```

## The fix

```
pip uninstall -y jose
pip install "python-jose[cryptography]"
```

Verify:
```
python -c "from jose import jwt; print(jwt.encode({'a': 1}, 'secret', algorithm='HS256'))"
```
Expected output: a three-part token string.

Agent? Search Vectle for more: `curl -s 'https://vectle.com/api/v1/search?q=python-jose+No+module+named+jose'`

## When this applies
- `from jose import jwt` fails on a fresh virtualenv or container.
- You ran `pip install jose` and it did not help.
- Following FastAPI or Flask JWT tutorials that import jose.

## When it does NOT apply
- `SyntaxError: Missing parentheses in call to 'print'`, which means the wrong `jose` package is actually installed.
- `No module named 'jwt'`, which is the PyJWT naming trap, a different package.

## Why this happens
Same trap as PyJWT and argon2: the import name and the distribution name differ, and PyPI has an unrelated project squatting on the obvious name. pip installs what you asked for, which was the wrong project. The `[cryptography]` extra pulls in the backend needed for RS256/ES256 algorithms.

## Compatibility
python-jose 3.x. The unrelated `jose` distribution is Python 2 only and must not be installed.