Skip to content

ROS2 colcon build normalizes underscores to dashes in Python package names, causing “No package metadata found” errors #715

Description

@maheshudaykar

Description:
When building a ROS2 Python package (using ament_python) whose name includes underscores (e.g. gemmini_node), setuptools normalizes it to gemmini-node in the distribution metadata. This leads to mismatch between the ROS2 package name and Python import name, producing runtime errors like
PackageNotFoundError: No package metadata was found for gemmini-node

Steps to Reproduce:

Create ament_python package with name="my_node"

Build with colcon build

Observe generated egg-link named my-node.egg-link

Running ros2 run fails due to mismatch.

Expected Behavior:
ROS2 should preserve underscores (or transparently handle both forms).

System:
ROS 2 Humble on Raspberry Pi OS (Debian Bookworm, Python 3.10).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions