Skip to content

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

@maheshudaykar

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).

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