{"record":{"id":"62602be763cf7bb5","repo":"pypa/pip","slug":"entry-point-r-not-found","errorCode":null,"errorMessage":"Entry point %r not found","messagePattern":"Entry point %r not found","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"src/pip/_vendor/pkg_resources/__init__.py","lineNumber":3180,"sourceCode":"    ):\n        return cls.from_location(\n            _normalize_cached(filename), os.path.basename(filename), metadata, **kw\n        )\n\n    def as_requirement(self):\n        \"\"\"Return a ``Requirement`` that matches this distribution exactly\"\"\"\n        if isinstance(self.parsed_version, _packaging_version.Version):\n            spec = \"%s==%s\" % (self.project_name, self.parsed_version)\n        else:\n            spec = \"%s===%s\" % (self.project_name, self.parsed_version)\n\n        return Requirement.parse(spec)\n\n    def load_entry_point(self, group: str, name: str) -> _ResolvedEntryPoint:\n        \"\"\"Return the `name` entry point of `group` or raise ImportError\"\"\"\n        ep = self.get_entry_info(group, name)\n        if ep is None:\n            raise ImportError(\"Entry point %r not found\" % ((group, name),))\n        return ep.load()\n\n    @overload\n    def get_entry_map(self, group: None = None) -> dict[str, dict[str, EntryPoint]]: ...\n    @overload\n    def get_entry_map(self, group: str) -> dict[str, EntryPoint]: ...\n    def get_entry_map(self, group: str | None = None):\n        \"\"\"Return the entry point map for `group`, or the full entry map\"\"\"\n        if not hasattr(self, \"_ep_map\"):\n            self._ep_map = EntryPoint.parse_map(\n                self._get_metadata('entry_points.txt'), self\n            )\n        if group is not None:\n            return self._ep_map.get(group, {})\n        return self._ep_map\n\n    def get_entry_info(self, group: str, name: str):\n        \"\"\"Return the EntryPoint object for `group`+`name`, or ``None``\"\"\"","sourceCodeStart":3162,"sourceCodeEnd":3198,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_vendor/pkg_resources/__init__.py#L3162-L3198","documentation":"Raised as ImportError in Distribution.load_entry_point() at line 3180 when get_entry_info(group, name) returns None — meaning no entry point with that name exists in that group for this distribution. The message includes the (group, name) tuple for diagnosis.","triggerScenarios":"Calling `dist.load_entry_point('console_scripts', 'mycli')` on a distribution that has no 'mycli' entry point under 'console_scripts'. get_entry_info returns None when the name is absent from the parsed entry point map.","commonSituations":"Looking up a console_scripts or plugin entry point that was renamed or removed; querying the wrong distribution; version mismatch where the entry point was added in a later release; typo in the entry point name.","solutions":["Inspect available entry points with `dist.get_entry_map(group)` to see valid names.","Correct the group or name to match what the package actually declares.","Upgrade or downgrade the package to a version that has the desired entry point.","Guard with try/except ImportError before calling load_entry_point."],"exampleFix":"// before\ndist.load_entry_point('console_scripts', 'old_name')\n# ImportError: Entry point ('console_scripts', 'old_name') not found\n\n// after\navailable = dist.get_entry_map('console_scripts')\nname = next(iter(available), None)\nif name:\n    dist.load_entry_point('console_scripts', name)","handlingStrategy":"validation","validationCode":"def entry_point_exists(dist, group, name) -> bool:\n    ep_map = dist.get_entry_map(group)\n    return name in ep_map","typeGuard":"def has_entry_point(dist, group: str, name: str) -> bool:\n    return dist.get_entry_info(group, name) is not None\n","tryCatchPattern":"try:\n    func = dist.load_entry_point('console_scripts', 'mycli')\nexcept ImportError:\n    func = None  # entry point not found; skip or fallback\n","preventionTips":["Call get_entry_map() or get_entry_info() before load_entry_point().","Guard with try/except ImportError in plugin loading code.","Verify entry point names against actual metadata."],"tags":["entry-points","pkg-resources","import","distribution"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}