{"record":{"id":"340eebcbaefc3758","repo":"pypa/pip","slug":"link-filename-is-not-a-supported-wheel-on-this-p","errorCode":null,"errorMessage":"{link.filename} is not a supported wheel on this platform.","messagePattern":"(.+?) is not a supported wheel on this platform\\.","errorType":"exception","errorClass":"UnsupportedWheel","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/resolution/resolvelib/factory.py","lineNumber":141,"sourceCode":"            self._installed_dists = {\n                dist.canonical_name: dist\n                for dist in env.iter_installed_distributions(local_only=False)\n            }\n        else:\n            self._installed_dists = {}\n\n    @property\n    def force_reinstall(self) -> bool:\n        return self._force_reinstall\n\n    def _fail_if_link_is_unsupported_wheel(self, link: Link) -> None:\n        if not link.is_wheel:\n            return\n        wheel = Wheel(link.filename)\n        if wheel.supported(self._finder.target_python.get_unsorted_tags()):\n            return\n        msg = f\"{link.filename} is not a supported wheel on this platform.\"\n        raise UnsupportedWheel(msg)\n\n    def _make_extras_candidate(\n        self,\n        base: BaseCandidate,\n        extras: frozenset[str],\n        *,\n        comes_from: InstallRequirement | None = None,\n    ) -> ExtrasCandidate:\n        cache_key = (id(base), frozenset(canonicalize_name(e) for e in extras))\n        try:\n            candidate = self._extras_candidate_cache[cache_key]\n        except KeyError:\n            candidate = ExtrasCandidate(base, extras, comes_from=comes_from)\n            self._extras_candidate_cache[cache_key] = candidate\n        return candidate\n\n    def _make_candidate_from_dist(\n        self,","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/resolution/resolvelib/factory.py#L123-L159","documentation":"_fail_if_link_is_unsupported_wheel (factory.py:134-141) in the new (resolvelib) resolver checks a link's wheel tags against the finder's target_python.get_unsorted_tags(); if none match it raises UnsupportedWheel. Same platform-compatibility guard as the legacy resolver but applied when the resolvelib factory builds candidates from links.","triggerScenarios":"The new resolver encounters a wheel link (from an index or direct URL) whose tags don't intersect the target platform's supported tags.","commonSituations":"Wrong-platform wheel on PyPI or a private index; --platform/--abi/--python-version target flags inconsistent with available wheels; cross-target installs.","solutions":["Use a wheel whose tags match your platform/Python/ABI.","Build from sdist so pip compiles a compatible wheel.","Set --platform, --abi, and --python-version together to match the target when doing offline/cross-platform resolution."],"exampleFix":"# before\npip install https://index.example.com/pkg-1.0-cp36-win_amd64.whl   # on Linux\n# after\npip install pkg==1.0   # let resolver pick a Linux wheel","handlingStrategy":"validation","validationCode":"# Verify a link's wheel is supported before passing it to the resolver.\nfrom pip._internal.utils.compatibility_tags import get_supported\nfrom pip._internal.utils.wheel import Wheel\nimport sys\nlink_file = sys.argv[1]\nw = Wheel(link_file)\nassert w.supported(get_supported()), f\"{link_file} unsupported on this platform\"\nprint(\"OK\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Publish wheels for all target platforms in your index.","When cross-targeting, pass matching --platform/--abi/--python-version.","Provide sdists as a fallback so pip can build locally."],"tags":["wheel","platform","compatibility"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}