python install_error ai_generated true

ERROR: foo-1.0-py3-none-any.whl is not a supported wheel on this platform.

ID: python/pip-wheel-not-supported-purelib

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-03-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

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).

generic

中文

pip 拒绝标签与当前解释器/平台不匹配的 wheel。通常是 wheel 为不同的 Python ABI 构建(例如在 cp312 解释器上使用 cp311),或平台标签不兼容(在 linux 上使用 win_amd64)。

Workarounds

  1. 90% success
    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
  2. 75% success
    pip install --no-binary foo foo

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The filename tag is metadata only; the binary inside still targets another ABI and crashes at import with undefined symbols.

  2. 85% fail

    Force-reinstall does not bypass tag compatibility checks.