{"id":"9551fc15dea25808","repo":"pypa/pip","slug":"wheel-filename-is-not-a-supported-wheel-for-this","errorCode":null,"errorMessage":"{wheel.filename} is not a supported wheel for this platform. It can't be sorted.","messagePattern":"(.+?) is not a supported wheel for this platform\\. It can't be sorted\\.","errorType":"exception","errorClass":"UnsupportedWheel","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/index/package_finder.py","lineNumber":561,"sourceCode":"              comparison operators, but then different sdist links\n              with the same version, would have to be considered equal\n        \"\"\"\n        valid_tags = self._supported_tags\n        support_num = len(valid_tags)\n        build_tag: BuildTag = ()\n        binary_preference = 0\n        link = candidate.link\n        if link.is_wheel:\n            # can raise InvalidWheelFilename\n            wheel = Wheel(link.filename)\n            try:\n                pri = -(\n                    wheel.find_most_preferred_tag(\n                        valid_tags, self._wheel_tag_preferences\n                    )\n                )\n            except ValueError:\n                raise UnsupportedWheel(\n                    f\"{wheel.filename} is not a supported wheel for this platform. It \"\n                    \"can't be sorted.\"\n                )\n            if self._prefer_binary:\n                binary_preference = 1\n            build_tag = wheel.build_tag\n        else:  # sdist\n            pri = -(support_num)\n        has_allowed_hash = int(link.is_hash_allowed(self._hashes))\n        yank_value = -1 * int(link.is_yanked)  # -1 for yanked.\n        return (\n            has_allowed_hash,\n            yank_value,\n            binary_preference,\n            candidate.version,\n            pri,\n            build_tag,\n        )","sourceCodeStart":543,"sourceCodeEnd":579,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/index/package_finder.py#L543-L579","documentation":"UnsupportedWheel raised in LinkComparer._candidate_sort_key when a wheel filename parses structurally but none of its tags match any platform/python/abi tag the current interpreter supports (wheel.find_most_preferred_tag raises ValueError). The wheel is therefore unrankable and cannot be selected for installation.","triggerScenarios":"A candidate wheel whose tags (e.g. cp39-cp39-manylinux1_x86_64) do not intersect self._supported_tags for the running interpreter (e.g. CPython 3.11 on macOS arm64). Reached while sorting InstallationCandidate objects during dependency resolution.","commonSituations":"Trying to install a Linux-only wheel on macOS/Windows or vice versa; a cpXY wheel on a different CPython minor version; a platform wheel on PyPy; an old wheel with tags predating the current tagging scheme; a cross-architecture install (x86 wheel on arm64).","solutions":["Use a wheel matching your interpreter: correct CPython version (cpXY), ABI, and platform tags (use 'pip debug --verbose' to list compatible tags).","Force a source build by removing --only-binary / loosening --no-binary so pip falls back to the sdist.","Upgrade the package to a version that ships wheels for your platform.","If building for another target, use the right interpreter/ABI (e.g. the embedded Python) rather than the system one."],"exampleFix":"# before - wrong platform wheel selected\npip install somepkg  # cp39 wheel, you run cp311\n\n# after\npip install --no-binary=:all: somepkg   # build from sdist\n# or upgrade to a release with cp311 wheels\npip install -U somepkg","handlingStrategy":"validation","validationCode":"from pip._internal.utils.compatibility_tags import get_supported\ntags = get_supported()\nfrom pip._internal.models.wheel import Wheel\nw = Wheel('somepkg-1.0-cp39-cp39-manylinux1_x86_64.whl')\ntry:\n    w.find_most_preferred_tag(tags, tags)\n    print('compatible')\nexcept ValueError:\n    print('NOT compatible with this interpreter')","typeGuard":"def wheel_supported(filename: str) -> bool:\n    from pip._internal.utils.compatibility_tags import get_supported\n    from pip._internal.models.wheel import Wheel\n    try:\n        Wheel(filename).find_most_preferred_tag(get_supported(), get_supported())\n        return True\n    except (ValueError, Exception):\n        return False","tryCatchPattern":"from pip._internal.exceptions import UnsupportedWheel\ntry:\n    finder._candidate_sort_key(candidate)\nexcept UnsupportedWheel as e:\n    logger.info('skipping incompatible wheel: %s', e)","preventionTips":["Run 'pip debug --verbose' to see compatible tags before pinning wheels.","Allow sdist fallback (avoid --only-binary) for cross-platform robustness.","Pin wheels only for the exact target interpreter/ABI/platform.","Use 'pip index versions' to confirm wheel availability."],"tags":["wheel","platform","tags","compatibility"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}