7
$\begingroup$

I get the following error when trying to build my python package with Colcon build

    [0.235s] ERROR:colcon.colcon_core.package_augmentation:Exception in package augmentation extension 'python':
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/package_augmentation/__init__.py", line 97, in augment_packages
    retval = extension.augment_packages(
  File "/usr/lib/python3/dist-packages/colcon_installed_package_information/package_augmentation/python.py", line 44, in augment_packages
    dist = next(iter(dists))
StopIteration

What could be the reason for this error and how can I solve it?

$\endgroup$

2 Answers 2

5
$\begingroup$

My error went away after I ran the following commands:

  • sudo apt update
  • sudo apt upgrade

Running these commands updated the following packages which fixed my issue:

  • python3-colcon-cd
  • python3-colcon-core
  • python3-colcon-installed-package-information
$\endgroup$
2
$\begingroup$

I was having the same issue as you and I managed to somewhat fix it.

To fix it I built with colcon after a clean terminal -- as in without any sources to any ros2 installations -- and got no warning/error messages.

I'm now curious as to why sourcing ROS2 Humble at /opt/ros/<ros_distro>/setup.bash is giving this error when colcon building.

Edit: Seems like as of today (18-03-2024) the colcon packages have been updated and this issue has been fixed, even when sourcing the ros2 distros. Case closed.

I'm still curious what went wrong tho...

$\endgroup$
2
  • $\begingroup$ It is great that you found a solution. However, please do not ask follow up questions in your answers posts. If you have a new question, then please hit the "Ask Question" button at the top of the page. The answers section is not where questions should be asked. Thanks. $\endgroup$ Commented Mar 19 at 9:19
  • 1
    $\begingroup$ I appreciate your input, @Greenonline. Just to clarify, my response was more of a thought than a question. Moving forward, it might help to distinguish between thoughts and inquiries. Thank you for your understanding. $\endgroup$ Commented Mar 20 at 3:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.