python
install_error
ai_generated
true
错误:foo-1.0-py3-none-any.whl 在此平台上不受支持的 wheel。
ERROR: foo-1.0-py3-none-any.whl is not a supported wheel on this platform.
ID: python/pip-wheel-not-supported-purelib
80%修复率
86%置信度
0证据数
2024-03-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
pip 拒绝标签与当前解释器/平台不匹配的 wheel。通常是 wheel 为不同的 Python ABI 构建(例如在 cp312 解释器上使用 cp311),或平台标签不兼容(在 linux 上使用 win_amd64)。
English
pip rejects a wheel whose tag does not match the current interpreter/platform. Often the wheel was built for a different Python ABI (e.g., cp311 on a cp312 interpreter) or the platform tag is incompatible (win_amd64 on linux).
解决方案
-
90% 成功率
python -c 'import sys; print(sys.implementation.cache_tag)' # download correct tag, e.g. cp312 pip download --only-binary=:all: --python-version 312 --platform manylinux2014_x86_64 foo
-
75% 成功率
pip install --no-binary foo foo
无效尝试
常见但无效的做法:
-
90% 失败
The filename tag is metadata only; the binary inside still targets another ABI and crashes at import with undefined symbols.
-
85% 失败
Force-reinstall does not bypass tag compatibility checks.