Environment
- Operating System: [e.g., Ubuntu 22.04]
- ROS2 Version: Humble
- Python Version: [e.g., 3.10]
- Build Tool: colcon
- Installation type: [e.g., from source, following the official documentation]
Description
I encountered an ImportError when attempting to build the motion_capture_tracking_interfaces
Steps to Reproduce
- Set up a ROS 2 Humble environment according to the ROS 2 documentation.
- Create a workspace for
motion_capture_tracking_interfaces and clone the repositories into the src directory.
- Run
rosdep install --from-paths src --ignore-src --rosdistro humble -y to install dependencies.
- Attempt to build the workspace with
colcon build.
The build process fails with the following error for the motion_capture_tracking_interfaces package:
--- stderr: motion_capture_tracking_interfaces
Traceback (most recent call last):
File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 8, in
from rosidl_generator_py import generate_py
ImportError: cannot import name 'generate_py' from 'rosidl_generator_py' (/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/init.py)
gmake[2]: *** [motion_capture_tracking_interfaces__py/CMakeFiles/motion_capture_tracking_interfaces__py.dir/build.make:155: rosidl_generator_py/motion_capture_tracking_interfaces/_motion_capture_tracking_interfaces_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:590: motion_capture_tracking_interfaces__py/CMakeFiles/motion_capture_tracking_interfaces__py.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed <<< motion_capture_tracking_interfaces [1.54s, exited with code 2]
Additional Context
- I confirmed that my ROS 2 environment is sourced correctly.
- Python dependencies were checked and are all present.
- Similar builds in the same environment for other packages do not encounter this issue.
Any guidance or suggestions to resolve this build error would be greatly appreciated.
Environment
Description
I encountered an ImportError when attempting to build the
motion_capture_tracking_interfacesSteps to Reproduce
motion_capture_tracking_interfacesand clone the repositories into thesrcdirectory.rosdep install --from-paths src --ignore-src --rosdistro humble -yto install dependencies.colcon build.The build process fails with the following error for the
motion_capture_tracking_interfacespackage:--- stderr: motion_capture_tracking_interfaces
Traceback (most recent call last):
File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 8, in
from rosidl_generator_py import generate_py
ImportError: cannot import name 'generate_py' from 'rosidl_generator_py' (/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/init.py)
gmake[2]: *** [motion_capture_tracking_interfaces__py/CMakeFiles/motion_capture_tracking_interfaces__py.dir/build.make:155: rosidl_generator_py/motion_capture_tracking_interfaces/_motion_capture_tracking_interfaces_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:590: motion_capture_tracking_interfaces__py/CMakeFiles/motion_capture_tracking_interfaces__py.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed <<< motion_capture_tracking_interfaces [1.54s, exited with code 2]
Additional Context
Any guidance or suggestions to resolve this build error would be greatly appreciated.