0

I am getting this error when using the colcon build command. I don't know how this occurred and everything was working really fine.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2866, in get_entry_map
    ep_map = self._ep_map
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2828, in __getattr__
    raise AttributeError(attr)
AttributeError: _ep_map. Did you mean: '_dep_map'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/colcon", line 11, in <module> load_entry_point('colcon-core==0.11.0', 'console_scripts', 'colcon')() File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 118, in main return _main(command_name=command_name, argv=argv) File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 143, in _main parser = create_parser('colcon_core.environment_variable') File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 240, in create_parser get_environment_variables_epilog( File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 289, in get_environment_variables_epilog entry_points = load_entry_points(group_name) File "/usr/lib/python3/dist-packages/colcon_core/entry_point.py", line 116, in load_entry_points for entry_point in get_entry_points(group_name).values(): File "/usr/lib/python3/dist-packages/colcon_core/entry_point.py", line 94, in get_entry_points for entry_point in iter_entry_points(group=group_name): File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 646, in <genexpr> for entry in dist.get_entry_map(group).values() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2868, in get_entry_map ep_map = self._ep_map = EntryPoint.parse_map( File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2557, in parse_map maps[group] = cls.parse_group(group, lines, dist) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2535, in parse_group ep = cls.parse(line, dist) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2513, in parse raise ValueError(msg, src) ValueError: ("EntryPoint must be in 'name=module:attrs [extras]' format", '<<<<<<< HEAD')

Things I have tried!

I haven't found any solution online, and also the auto completion for colcon is also not working

  • I have tried re-installing python3-colcon-common-extensions package using
sudo apt install python3-colcon-common-extensions

also I have these sources in my .bashrc file

# ros-humble-source
source /opt/ros/humble/setup.bash

colcon_cd command setup

source /usr/share/colcon_cd/function/colcon_cd.sh export _colcon_cd_root=/opt/ros/humble/

colcon tab completion

source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash

Jishnu
  • 191
  • 1
  • 12

1 Answers1

1

The error that you're getting is ValueError: ("EntryPoint must be in 'name=module:attrs [extras]' format", '<<<<<<< HEAD')

This suggests that you have a setup.py file in your Python search path which has invalid syntax. Most likely this is somewhere in your workspace and not an installed package or in the build tool like colcon.

I don't know how this occurred and everything was working really fine.

I would try to think back carefully about what changed in this period between when things were working and weren't working as that's likely the best way to find out what was wrong on your system.

Tully
  • 24,992
  • 1
  • 17
  • 35
  • I also noticed that you've asked a related comment about downgrading SetupTools here: https://robotics.stackexchange.com/questions/24230/setuptoolsdeprecationwarning-in-ros2-humble as this is in that codepath it might be a related issue to how you downgraded SetupTools. Please make sure to provide enough information to reproduce your problem otherwise all we can do is guess at a solution. – Tully Jan 17 '23 at 09:27
  • actually I am not getting this error in any ros2 workspace, its occurring in every terminal window. I haven't noticed or unknowingly included any setup.py file in the build tool folders. I am totally confused on how this actually have happened. I have tried to reinstall ros2 humble but the issue was not resolved. – Jishnu Jan 17 '23 at 10:08
  • I have checked the .bashrc file and the issue was probably a source command to a custom ros workspace that I have created, the issue got resolved once I removed the source script from the bash file, Thank you! – Jishnu Jan 17 '23 at 12:27
  • I'm glad you were able to find the solution. Please accept the answer so others know that this is resolved and don't spend more time trying to find an answer. – Tully Jan 17 '23 at 18:06