{"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":891,"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":873,"sourceCodeEnd":906,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_vendor/packaging/pylock.py#L873-L906","documentation":"Raised as PylockSelectError (pylock.py:891) by Pylock.select() when a package that has wheels yields no wheel compatible with the provided/derived tags (create_compatible_tags_selector returns nothing) AND the package has no sdist to fall back to. It is the final 'no source available' guard in the install-source selection ladder.","triggerScenarios":"select(tags=my_tags) on a package whose wheels are all for other platforms/ABIs (e.g. only cp312-win_amd64 wheels, selecting on linux) and whose sdist is unset. Also fires with default sys_tags() when the host has no matching wheel and no sdist exists.","commonSituations":"Platform-specific project (e.g. binary-only) installed on an unsupported platform. A lock that dropped the sdist entry to save space. tags mismatch caused by a non-standard interpreter (PyPy, GraalPy) with no matching wheels.","solutions":["Add an sdist entry to the package so selection can fall back to building from source.","Add a wheel matching your platform/ABI/interpreter to the wheels list.","Pass tags= that match one of the existing wheels, or run on a supported platform."],"exampleFix":"# before: only Windows wheels, no sdist, installing on Linux\n[[packages]]\nname = \"foo\"\nwheels = [{ filename = \"foo-1.0-cp312-cp312-win_amd64.whl\", url = \"...\" }]\n\n# after: add an sdist fallback\n[[packages]]\nname = \"foo\"\nwheels = [{ filename = \"foo-1.0-cp312-cp312-win_amd64.whl\", url = \"...\" }]\n[packages.sdist]\nfilename = \"foo-1.0.tar.gz\"","handlingStrategy":"validation","validationCode":"from pip._vendor.packaging.tags import create_compatible_tags_selector, sys_tags\nfrom pip._vendor.packaging.utils import parse_wheel_filename\ndef package_installable_for_tags(package, tags=None):\n    selector = create_compatible_tags_selector(tags or sys_tags())\n    if package.get('wheels'):\n        hit = selector((w, parse_wheel_filename(w['filename'])[-1]) for w in package['wheels'])\n        return hit is not None or bool(package.get('sdist'))\n    return True","typeGuard":"null","tryCatchPattern":"from pip._vendor.packaging.pylock import PylockSelectError\ntry:\n    list(pylock.select(tags=my_tags))\nexcept PylockSelectError as e:\n    if 'No wheel found' in str(e):\n        add_sdist_or_matching_wheel(e)","preventionTips":["Always include an sdist for platform-specific packages so selection can fall back.","Author wheels covering every platform/interpreter you intend to support."],"tags":["pylock","select","wheels","platform"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}