# Colcon 构建 Python 包报 StopIteration

> 原文链接：https://robotics.hellobike.com/pitfalls/2024-03-19-robotics-se-110021
> 频道：pitfalls | 更新日期：2024-03-19 | 标签：auto, stackexchange, ros2, ros-humble, build, colcon
> 核心摘要：ROS2 Humble 中用 Colcon 构建 Python 包报包增强错误，运行 sudo apt update 和 sudo apt upgrade 后解决。

# Colcon 构建 Python 包报 StopIteration

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：["colcon_core.package_augmentation" Error When Building Python Package With Colcon in ROS2 Humble](https://robotics.stackexchange.com/questions/110021/colcon-core-package-augmentation-error-when-building-python-package-with-colco)（Robotics Stack Exchange #110021）

**状态**：有绕过办法

## 问题

使用 `colcon build` 构建 Python 包时报错：`ERROR:colcon.colcon_core.package_augmentation`，扩展 `python` 中出现 `StopIteration`。

## 环境

ROS 2

## 解决办法

1. 运行 `sudo apt update`
2. 运行 `sudo apt upgrade`
3. 原文称更新 `python3-colcon-cd`、`python3-colcon-core`、`python3-colcon-installed-package-information` 后问题消失。

原问题作者：umut373；采纳答案作者：Ritish Shailly。原内容依 CC BY-SA 4.0 授权，本页摘要同样依 CC BY-SA 4.0 授权。
:::

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #110021："colcon_core.package_augmentation" Error When Building Python Package With Colcon in ROS2 Humble](https://robotics.stackexchange.com/questions/110021/colcon-core-package-augmentation-error-when-building-python-package-with-colco)