# SetuptoolsDeprecationWarning: setup.py install 已弃用。请使用 build 和 pip 等基于标准的工具。

- **ID:** `python/setuptools-deprecated-use-of-setup-py`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

用户调用了 `python setup.py install`（或调用它的工具），而不是使用 pip/build。现代 setuptools 会告警，并最终移除该路径。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Replace `python setup.py install` with:
  python -m pip install .
For editable installs:
  python -m pip install -e .
For building distributions:
  python -m build
   ```
2. **** (85% 成功率)
   ```
   If you maintain the package, migrate metadata from setup.py to pyproject.toml [project] table and keep setup.py only as a shim.
   ```

## 无效尝试

- **** — Hides the symptom but the legacy path is still used and will break in future setuptools releases. (70% 失败率)
- **** — Downgrading setuptools breaks other packages that require modern setuptools for PEP 517/518 builds. (85% 失败率)
