python install_error ai_generated true

错误:包 'package' 需要不同的 Python 版本:3.9.0 不在 '>=3.10' 范围内

ERROR: Package 'package' requires a different Python: 3.9.0 not in '>=3.10'

ID: python/setuptools-requires-python-mismatch

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

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

包的 requires-python 元数据指定的 Python 版本范围不包括当前解释器。

English

The package's requires-python metadata specifies a Python version range that does not include the current interpreter.

generic

解决方案

  1. 85% 成功率
    pip install 'package<2.0'  # version that supports Python 3.9
  2. 90% 成功率
    pyenv install 3.10.0; pyenv virtualenv 3.10.0 myenv; pyenv activate myenv; pip install package

无效尝试

常见但无效的做法:

  1. 60% 失败

    May install a package incompatible with your Python version, leading to runtime errors.

  2. 50% 失败

    If the required version is a major jump, it may not be feasible or supported by other dependencies.