# error: invalid command class 'foo.bar'  # from [options.entry_points] or unknown setup.cfg key

- **ID:** `python/setuptools-setup-cfg-unknown-key`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A setup.cfg section or key is misspelled or unsupported by the installed setuptools version (e.g. a key from a newer setuptools used with an older one), so setuptools treats it as an invalid command.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   Upgrade setuptools to one that supports the key: python -m pip install --upgrade setuptools  # then rebuild
   ```
2. **** (78% success)
   ```
   Validate the config: python -c "import configparser; c=configparser.ConfigParser(); c.read('setup.cfg'); print(c.sections())"  # compare keys against setuptools docs
   ```

## Dead Ends

- **** — Disabling isolation doesn't fix an unknown config key; the same invalid command error is raised by the local setuptools. (60% fail)
- **** — Removes all metadata and entry points, causing a different failure (missing name/version) instead of fixing the key. (75% fail)
