# 弃用警告：pkg_resources 作为 API 已弃用。请参阅 https://setuptools.pypa.io/en/latest/pkg_resources.html

- **ID:** `python/setuptools-pkg-resources-deprecation-warning`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

setuptools 中的 pkg_resources 模块已被弃用，并将在未来版本中移除。代码或依赖项仍在导入它，从而触发警告。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (85% 成功率)
   ```
   Replace pkg_resources usage with importlib.metadata and importlib.resources from the standard library.
   ```
2. **** (80% 成功率)
   ```
   If the warning comes from a third-party package, update it to the latest version that no longer uses pkg_resources.
   ```

## 无效尝试

- **** — Hides the warning but does not fix the underlying deprecated usage; future removal will break the code. (90% 失败率)
- **** — Temporary workaround but loses security fixes and new features; not sustainable. (70% 失败率)
