python install_error ai_generated true

错误:无法识别的选项 --use-2to3 用法:setup.py [global_opts] cmd1 [cmd1_opts] ... setup.py: 错误:无此选项:--use-2to3

error: option --use-2to3 not recognized usage: setup.py [global_opts] cmd1 [cmd1_opts] ... setup.py: error: no such option: --use-2to3

ID: python/setuptools-use-2to3-removed

其他格式: JSON · Markdown 中文 · English
80%修复率
86%置信度
0证据数
2024-02-15首次发现

版本兼容性

版本状态引入弃用备注
3.7 active — — —
3.8 active — — —
3.9 active — — —
3.10 active — — —

根因分析

setuptools 58+ 移除了 2to3 构建支持。setup.py 中带有 `use_2to3=True` 的包现在会失败,因为该选项已不存在。

English

setuptools 58+ removed the 2to3 build support. Packages with `use_2to3=True` in setup.py now fail because the option no longer exists.

generic

解决方案

  1. 80% 成功率
    pip install 'setuptools<58' wheel
    pip install --no-build-isolation <package>
  2. 75% 成功率
    pip install --only-binary=:all: <package>

无效尝试

常见但无效的做法:

  1. 70% 失败

    Many legacy packages are unmaintained; the latest release still contains use_2to3=True.

  2. 95% 失败

    The 2to3 tool is part of the stdlib; installing a package named 2to3 does not restore setuptools' removed option.