{"record":{"id":"cc6101bd3fb4d054","repo":"pypa/pip","slug":"no-wheel-found-matching-the-provided-tags-for-pack","errorCode":null,"errorMessage":"No wheel found matching the provided tags for package {package.name!r} at packages[{package_index}], and no sdist available as a fallback","messagePattern":"No wheel found matching the provided tags for package (.+?) at packages\\[(.+?)\\], and no sdist available as a fallback","errorType":"exception","errorClass":"PylockSelectError","httpStatus":null,"severity":"error","filePath":"src/pip/_vendor/packaging/pylock.py","lineNumber":929,"sourceCode":"            # - Else if there are entries for :ref:`pylock-packages-wheels`:\n            elif package.wheels:\n                # #. Look for the appropriate wheel file based on\n                #    :ref:`pylock-packages-wheels-name`; if one is not found then move\n                #    on to :ref:`pylock-packages-sdist` or an error MUST be raised about\n                #    a lack of source for the project.\n                best_wheel = next(\n                    compatible_tags_selector(\n                        (wheel, parse_wheel_filename(wheel.filename)[-1])\n                        for wheel in package.wheels\n                    ),\n                    None,\n                )\n                if best_wheel:\n                    yield package, best_wheel\n                elif package.sdist is not None:\n                    yield package, package.sdist\n                else:\n                    raise PylockSelectError(\n                        f\"No wheel found matching the provided tags \"\n                        f\"for package {package.name!r} \"\n                        f\"at packages[{package_index}], \"\n                        f\"and no sdist available as a fallback\"\n                    )\n\n            # - Else if no :ref:`pylock-packages-wheels` file is found or\n            #   :ref:`pylock-packages-sdist` is solely set:\n            elif package.sdist is not None:\n                yield package, package.sdist\n\n            else:\n                # Covered by lock.validate() which is a precondition for this method.\n                raise NotImplementedError  # pragma: no cover\n","sourceCodeStart":911,"sourceCodeEnd":944,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_vendor/packaging/pylock.py#L911-L944","documentation":"PylockSelectError raised by Pylock.select when a package has wheels but none matches the (provided or default) compatibility tags, and the package has no sdist to fall back to. PEP 751 wheel selection picks the best wheel via create_compatible_tags_selector; if that yields nothing and there is no sdist, there is no installable artifact.","triggerScenarios":"Calling pylock.select(tags=...) (or defaulting to sys_tags()) for a package whose wheels are all for other platforms/Python versions (e.g. only 'cp312-cp312-win_amd64' wheels while selecting on Linux CPython 3.11) and whose sdist is absent.","commonSituations":"A cross-platform lock without a wheel for your interpreter/platform; running on a different Python than the lock was built for; tags= passed explicitly that are too narrow.","solutions":["Inspect the package's wheels and confirm none carries a tag your interpreter emits (run packaging.tags.sys_tags() to see them).","Add a wheel matching your platform/python to the package entry, or add an sdist as a fallback.","Pass a broader tags= argument (or omit it to use sys_tags()) so a compatible wheel can be selected.","Regenerate the lock on the target platform so it includes a matching wheel or an sdist."],"exampleFix":"# before: package only has windows wheel, selecting on linux\n[[packages]]\nname = \"foo\"\n  [[packages.wheels]]\n  filename = \"foo-1.0-cp312-cp312-win_amd64.whl\"\n\n# after: add a manylinux wheel or an sdist fallback\n[[packages]]\nname = \"foo\"\n  [[packages.wheels]]\n  filename = \"foo-1.0-cp312-cp312-manylinux_2_17_x86_64.whl\"\n  [packages.sdist]\n  filename = \"foo-1.0.tar.gz\"","handlingStrategy":"validation","validationCode":"from packaging.tags import sys_tags, create_compatible_tags_selector\nfrom packaging.utils import parse_wheel_filename\n\ndef package_has_installable_artifact(package, tags=None) -> bool:\n    if package.sdist is not None or package.vcs or package.directory or package.archive:\n        return True\n    selector = create_compatible_tags_selector(tags or sys_tags())\n    for w in package.wheels or []:\n        if selector([(w, parse_wheel_filename(w.filename)[-1])]) is not None:\n            return True\n    return False\n\nfor p in pylock.packages:\n    assert package_has_installable_artifact(p), p.name","typeGuard":"null","tryCatchPattern":"from packaging.pylock import PylockSelectError\ntry:\n    list(pylock.select(tags=tags))\nexcept PylockSelectError as e:\n    # add a matching wheel or an sdist; widen tags\n    report(e)","preventionTips":["Always include an sdist per package as a universal fallback.","Generate locks on each target platform so a matching wheel exists.","Pass tags=None to let select() use the running interpreter's sys_tags()."],"tags":["pylock","packaging","select","wheel","tags","platform"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}