{"record":{"id":"cfeeedb49d700108","repo":"pypa/pip","slug":"error-parsing-entry-points-for-self-raw-name-e","errorCode":null,"errorMessage":"Error parsing entry points for {self.raw_name}: {e}","messagePattern":"Error parsing entry points for (.+?): (.+?)","errorType":"exception","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/metadata/importlib/_dists.py","lineNumber":206,"sourceCode":"        # zipfile.Path), it can never contain any distutils scripts.\n        if not isinstance(self._info_location, pathlib.Path):\n            return\n        for child in self._info_location.joinpath(\"scripts\").iterdir():\n            yield child.name\n\n    def read_text(self, path: InfoPath) -> str:\n        content = self._dist.read_text(str(path))\n        if content is None:\n            raise FileNotFoundError(path)\n        return content\n\n    def iter_entry_points(self) -> Iterable[BaseEntryPoint]:\n        # importlib.metadata's EntryPoint structure satisfies BaseEntryPoint.\n        try:\n            return self._dist.entry_points\n        except ValueError as e:\n            # Python 3.15+ validates entry points while parsing.\n            raise InstallationError(\n                f\"Error parsing entry points for {self.raw_name}: {e}\"\n            ) from e\n\n    def _metadata_impl(self) -> email.message.Message:\n        # From Python 3.10+, importlib.metadata declares PackageMetadata as the\n        # return type. This protocol is unfortunately a disaster now and misses\n        # a ton of fields that we need, including get() and get_payload(). We\n        # rely on the implementation that the object is actually a Message now,\n        # until upstream can improve the protocol. (python/cpython#94952)\n        metadata = self._dist.metadata\n        # From Python 3.15+, importlib.metadata may return None when no\n        # metadata file (METADATA or PKG-INFO) exists in the distribution\n        # directory. (python/cpython#132947)\n        if metadata is None:\n            return email.message.Message()\n        return cast(email.message.Message, metadata)\n\n    def iter_provided_extras(self) -> Iterable[NormalizedName]:","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/metadata/importlib/_dists.py#L188-L224","documentation":"Raised as InstallationError from Distribution.iter_entry_points in _dists.py:200-208 (importlib.metadata backend). On Python 3.15+ importlib.metadata validates entry points while parsing; a malformed entry_points.txt that raises ValueError is wrapped with the distribution's raw name so the offending package is identifiable.","triggerScenarios":"Accessing iter_entry_points() on a Distribution whose entry_points.txt contains a syntactically invalid entry (e.g. missing '=', bad syntax), causing importlib.metadata's entry_points property to raise ValueError.","commonSituations":"A package with a hand-edited or buggy entry_points.txt; a build backend that emitted malformed entry-point definitions; running under Python 3.15+ where validation is stricter.","solutions":["Reinstall the package from a version whose entry_points.txt is valid.","Fix the entry_points.txt / setup() entry_points definition in the source and rebuild.","Temporarily ignore the package's console scripts if they are not needed."],"exampleFix":"// before (entry_points.txt)\n[console_scripts]\nmycmd\n// after\n[console_scripts]\nmycmd = mypkg.cli:main","handlingStrategy":"try-catch","validationCode":"// Before iterating entry points, validate entry_points.txt parses:\nimport configparser, io\nep = dist.read_text('entry_points.txt')\nif ep:\n    cp = configparser.ConfigParser()\n    cp.read_string(ep)  # raises on malformed syntax","typeGuard":null,"tryCatchPattern":"from pip._internal.exceptions import InstallationError\ntry:\n    list(dist.iter_entry_points())\nexcept InstallationError as e:\n    if 'Error parsing entry points' in str(e):\n        # reinstall the package or ignore its scripts\n        ...","preventionTips":["Define entry points with valid 'name = module:attr' syntax.","Validate entry_points.txt during build before publishing.","Reinstall packages whose entry_points.txt is malformed."],"tags":["metadata","entry-points","importlib","parsing"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}