{"record":{"id":"47a343b1a614ea51","repo":"pypa/pip","slug":"none-metadata-name-metadata-found-for-distributi-47a343","errorCode":null,"errorMessage":"None {metadata_name} metadata found for distribution: {dist}","messagePattern":"None (.+?) metadata found for distribution: (.+?)","errorType":"exception","errorClass":"NoneMetadataError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/resolution/legacy/resolver.py","lineNumber":80,"sourceCode":"    \"\"\"\n    Check whether the given Python version is compatible with a distribution's\n    \"Requires-Python\" value.\n\n    :param version_info: A 3-tuple of ints representing the Python\n        major-minor-micro version to check.\n    :param ignore_requires_python: Whether to ignore the \"Requires-Python\"\n        value if the given Python version isn't compatible.\n\n    :raises UnsupportedPythonVersion: When the given Python version isn't\n        compatible.\n    \"\"\"\n    # This idiosyncratically converts the SpecifierSet to str and let\n    # check_requires_python then parse it again into SpecifierSet. But this\n    # is the legacy resolver so I'm just not going to bother refactoring.\n    try:\n        requires_python = str(dist.requires_python)\n    except FileNotFoundError as e:\n        raise NoneMetadataError(dist, str(e))\n    try:\n        is_compatible = check_requires_python(\n            requires_python,\n            version_info=version_info,\n        )\n    except specifiers.InvalidSpecifier as exc:\n        logger.warning(\n            \"Package %r has an invalid Requires-Python: %s\", dist.raw_name, exc\n        )\n        return\n\n    if is_compatible:\n        return\n\n    version = \".\".join(map(str, version_info))\n    if ignore_requires_python:\n        logger.debug(\n            \"Ignoring failed Requires-Python check for package %r: %s not in %r\",","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/resolution/legacy/resolver.py#L62-L98","documentation":"In the legacy resolver, _check_metadata_requires_python reads dist.requires_python (resolver.py:78-80); if accessing it raises FileNotFoundError, pip wraps it as NoneMetadataError. This signals an inconsistency: the distribution claims metadata exists but the METADATA/PKG-INFO file is missing or unreadable.","triggerScenarios":"Resolving a package whose .dist-info directory exists but whose METADATA file is missing, deleted, or unreadable (permission error) at the moment pip reads requires_python.","commonSituations":"Corrupted/partial installs; filesystem permission issues; packages whose dist-info was partially deleted; broken symlinks.","solutions":["Reinstall the offending package to restore its METADATA file.","Fix filesystem permissions on the site-packages/dist-info directory.","Remove the corrupted .dist-info directory and reinstall."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Verify METADATA files are readable for installed dists before resolving.\nimport importlib.metadata as md, pathlib\nfor dist in md.distributions():\n    try:\n        _ = dist.requires_python\n    except FileNotFoundError:\n        print(f\"Corrupt dist (missing METADATA): {dist.metadata['Name']}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Periodically validate installed dist-info directories are intact.","Avoid manually editing/deleting files inside site-packages.","Use pip to manage all installs/removals to keep metadata consistent."],"tags":["metadata","resolver","file-not-found"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}