'setup.cfg declaring console_scripts errors with "Entry points must be listed in groups"

I'm trying to configure setuptools to create a console entry point for my package, following the docs, and ending up with the following config:

[options.entry_points]
console_scripts = 
    hiplog = hiplog.scripts.hiplog:cli

But when I pip install -e . in my repository, pip raises the following error:

ERROR: Exception:
Traceback (most recent call last):
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2857, in get_entry_map
    ep_map = self._ep_map
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _ep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 397, in run
    installed = install_given_reqs(
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/req/__init__.py", line 75, in install_given_reqs
    uninstalled_pathset = requirement.uninstall(
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 685, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 571, in from_dist
    console_scripts = dist.get_entry_map(group='console_scripts')
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2859, in get_entry_map
    ep_map = self._ep_map = EntryPoint.parse_map(
  File "/home/taschan/.pyenv/versions/3.9.0/envs/hiplog/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2531, in parse_map
    raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups

What am I doing wrong?



Solution 1:[1]

I ran into this same symptom, and the root cause turned out to be a botched pip install -e . from a previous run. Deleting the projectname.egg-info directory did the trick.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 G__