ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Colcon build fails for ament_cmake_core

asked 2021-09-01 13:15:04 -0500

jehand1505 gravatar image

System: Ubuntu 20.04.3 (64)

I have been trying to run the colcon build--symlink-install command and every time I run it I get the error: No module named 'catkin_pkg' and it fails on ament_cmake_core. I have installed the package using sudo apt install python3-catkin-pkg and it still throws me the same error. Not sure how to fix this or why it is throwing the same error when it is installed. I have attached the full log below:

(base) jehan@jehan-VirtualBox:~/ros2_foxy$ colcon build --symlink-install
Starting >>> ament_package
Finished <<< ament_package [0.39s]            
Starting >>> ament_cmake_core
--- stderr: ament_cmake_core                          
Traceback (most recent call last):
  File "/home/jehan/ros2_foxy/src/ament/ament_cmake/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 21, in <module>
    from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at cmake/core/ament_package_xml.cmake:94 (message):
  execute_process(/home/jehan/anaconda3/bin/python3
  /home/jehan/ros2_foxy/src/ament/ament_cmake/ament_cmake_core/cmake/core/package_xml_2_cmake.py
  /home/jehan/ros2_foxy/src/ament/ament_cmake/ament_cmake_core/package.xml
  /home/jehan/ros2_foxy/build/ament_cmake_core/ament_cmake_core/package.cmake)
  returned error code 1
Call Stack (most recent call first):
  cmake/core/ament_package_xml.cmake:49 (_ament_package_xml)
  CMakeLists.txt:15 (ament_package_xml)

---
Failed   <<< ament_cmake_core [0.09s, exited with code 1]

Summary: 1 package finished [1.71s]
  1 package failed: ament_cmake_core
  1 package had stderr output: ament_cmake_core
  308 packages not processed
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-28 00:55:09 -0500

It looks like your python interpreter is using Anaconda in your home directory, which probably isn't using the system's Python package path. Either use the system's python interpreter, which shouldn't have any problems finding the system's Python packages, or install catkin_pkg and the rest of the Python packages needed for ROS 2 using the Anaconda python interpreter and pip.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-09-01 13:15:04 -0500

Seen: 1,326 times

Last updated: Oct 28 '21