# ValueError: Unknown projection '3d'

- **ID:** `python/matplotlib-3d-projection-error`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Trying to create a 3D subplot without importing mpl_toolkits.mplot3d or using an older matplotlib version where '3d' is not recognized.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.7 | active | — | — |
| 3.8 | active | — | — |

## Workarounds

1. **Import mpl_toolkits.mplot3d explicitly** (95% success)
   ```
   from mpl_toolkits.mplot3d import Axes3D; fig = plt.figure(); ax = fig.add_subplot(111, projection='3d')
   ```
2. **Use the built-in subplot_kw argument** (90% success)
   ```
   fig, ax = plt.subplots(subplot_kw={'projection': '3d'})
   ```

## Dead Ends

- **Installing mpl_toolkits via pip** — mpl_toolkits is part of matplotlib, not a separate package. (95% fail)
- **Using projection='3d' without importing anything** — The projection is registered only after importing mpl_toolkits.mplot3d. (90% fail)
