# DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

- **ID:** `python/setuptools-pkg-resources-deprecated`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Code imports pkg_resources (e.g., for entry points or resource access); setuptools 67+ flags it as deprecated in favor of importlib.metadata and importlib.resources.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   from importlib.metadata import entry_points
eps = entry_points(group='console_scripts')
for ep in eps:
    print(ep.name, ep.value)
   ```
2. **** (88% success)
   ```
   from importlib.resources import files
data = (files('mypkg') / 'data.txt').read_text()
   ```

## Dead Ends

- **** — Hides warnings but pkg_resources will be removed, breaking the code later. (75% fail)
- **** — Blocks security fixes and conflicts with packages that require newer setuptools. (80% fail)
