Python error is appeared when doing ROS2 colcon build

Viewed 591

I'm studying ROS2 foxy, and I have little problem about colcon build.

I just made colcon_ws with no packages. And when I try to build, some error messages are shown. Here is what I did.

$ mkdir colcon_ws
$ cd colcon_ws
$ colcon build

And error messages are here. Plus, something weird is that the error message appears, but the build succeeds.

ERROR:colcon.colcon_core.package_selection:Exception in package selection extension 'override_check': argument --allow-overriding: conflicting option string: --allow-overriding
Traceback (most recent call last):
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_core/package_selection/__init__.py", line 109, in _add_package_selection_arguments
    retval = extension.add_arguments(parser=group)
  File "/usr/lib/python3/dist-packages/colcon_override_check/package_selection/override_check.py", line 52, in add_arguments
    parser.add_argument(
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_defaults/argument_parser/defaults.py", line 78, in add_argument
    argument = super().add_argument(*args, **kwargs)
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_core/argument_parser/destination_collector.py", line 46, in add_argument
    argument = super().add_argument(*args, **kwargs)
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_core/argument_parser/type_collector.py", line 34, in add_argument
    ret = super().add_argument(*args, **kwargs)
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_core/argument_parser/__init__.py", line 171, in add_argument
    return self._parser.add_argument(*args, **kwargs)
  File "/home/msjun-ubuntu/.local/lib/python3.8/site-packages/colcon_argcomplete/argument_parser/argcomplete/__init__.py", line 49, in add_argument
    argument = self._parser.add_argument(*args, **kwargs)
  File "/usr/lib/python3.8/argparse.py", line 1398, in add_argument
    return self._add_action(action)
  File "/usr/lib/python3.8/argparse.py", line 1602, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
  File "/usr/lib/python3.8/argparse.py", line 1412, in _add_action
    self._check_conflict(action)
  File "/usr/lib/python3.8/argparse.py", line 1551, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/usr/lib/python3.8/argparse.py", line 1560, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --allow-overriding: conflicting option string: --allow-overriding

                     
Summary: 0 packages finished [0.31s]

How can I fix it?

1 Answers

Check the colcon-core version by: colcon version-check

See if the colcon-core is up-to-date or not. If it is not up-to-date, update it by:

sudo apt update
sudo apt install python3-colcon-common-extensions
sudo apt install python3-colcon-core
Related