How to fix colcon build fail?
Hi all,
I am trying to follow this tutorial https://index.ros.org/doc/ros2/Tutori... for ROS 2.0 Eloquent on Mac OS Catalina. This fails after entering the colcon build --symlink-install
command and I get this error message:
user@users-MBP ros2_example_ws % sudo colcon build --symlink-install
Password:
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
Starting >>> examples_rclcpp_minimal_client
Starting >>> examples_rclcpp_minimal_composition
--- stderr: examples_rclcpp_minimal_action_server
Traceback (most recent call last):
File "/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in <module>
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at /Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_package_templates-extras.cmake:41 (message):
execute_process(/usr/local/bin/python3
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
/Users/user/Desktop/ros2_example_ws/build/examples_rclcpp_minimal_action_server/ament_cmake_package_templates/templates.cmake)
returned error code 1
Call Stack (most recent call first):
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_coreConfig.cmake:38 (include)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:15 (find_package)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmakeConfig.cmake:38 (include)
CMakeLists.txt:13 (find_package)
---
Failed <<< examples_rclcpp_minimal_action_server [ Exited with code 1 ]
--- stderr: examples_rclcpp_minimal_action_client
Traceback (most recent call last):
File "/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in <module>
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at /Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_package_templates-extras.cmake:41 (message):
execute_process(/usr/local/bin/python3
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
/Users/user/Desktop/ros2_example_ws/build/examples_rclcpp_minimal_action_client/ament_cmake_package_templates/templates.cmake)
returned error code 1
Call Stack (most recent call first):
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_coreConfig.cmake:38 (include)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:15 (find_package)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmakeConfig.cmake:38 (include)
CMakeLists.txt:13 (find_package)
---
Aborted <<< examples_rclcpp_minimal_action_client
--- stderr: examples_rclcpp_minimal_composition
Traceback (most recent call last):
File "/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in <module>
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at /Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_package_templates-extras.cmake:41 (message):
execute_process(/usr/local/bin/python3
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
/Users/user/Desktop/ros2_example_ws/build/examples_rclcpp_minimal_composition/ament_cmake_package_templates/templates.cmake)
returned error code 1
Call Stack (most recent call first):
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_coreConfig.cmake:38 (include)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:15 (find_package)
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake/cmake/ament_cmakeConfig.cmake:38 (include)
CMakeLists.txt:13 (find_package)
---
Aborted <<< examples_rclcpp_minimal_composition
--- stderr: examples_rclcpp_minimal_client
Traceback (most recent call last):
File "/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in <module>
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at /Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/ament_cmake_package_templates-extras.cmake:41 (message):
execute_process(/usr/local/bin/python3
/Users/user/ros2_eloquent/ros2-osx/share/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
/Users/user/Desktop/ros2_example_ws/build/examples_rclcpp_minimal_client/ament_cmake_package_templates/templates.cmake)
returned error code 1
Call Stack ...