# packaging.markers.UndefinedEnvironmentName: 'extra' is not defined in environment markers

- **ID:** `python/packaging-marker-evaluation-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The marker uses 'extra' which is only valid in certain contexts like requirements files, not in all marker evaluations.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Requirement('package; sys_platform == "linux"')
   ```
2. **** (85% success)
   ```
   from packaging.markers import Marker; m = Marker('extra == "test"'); m.evaluate({'extra': 'test'})
   ```

## Dead Ends

- **** — The marker evaluation does not read arbitrary environment variables; 'extra' is a special key. (80% fail)
- **** — Ignoring may lead to incorrect dependency resolution. (50% fail)
