# ModuleNotFoundError: No module named 'cryptography'

TL;DR: run `pip install cryptography`. It was probably only a transitive dependency; declare it directly.

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

## The fix

```
pip install cryptography
```

Verify:
```
python -c "from cryptography.fernet import Fernet; print('ok')"
```
Expected output: ok.

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

## When this applies
- Fresh virtualenvs, containers, or CI runners.
- It worked locally because paramiko or pyOpenSSL pulled it in.
- Minimal Docker images.

## When it does NOT apply
- `cannot import name 'default_backend'`, which is a version problem with it installed.
- `No module named 'cryptography.hazmat.bindings._rust'`, which is a broken install.

## Why this happens
Nearly everything in Python crypto depends on cryptography, so it feels ubiquitous, but feeling ubiquitous is not being declared. When the package that dragged it in is removed or its extras change, the import breaks. Direct dependencies beat transitive ones.

## Compatibility
cryptography 41+ on all supported Pythons. Ships Rust-based wheels; needs no compiler on common platforms.