机器人 —— ros报错: CMake Error at /opt/ros/jazzy/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message): execute_process(/home/devil/.local/bin/python3.13







报错信息:




ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at /opt/ros/jazzy/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message):
execute_process(/home/devil/.local/bin/python3.13




原因:

colcon 编译时指定的Python路径不对,使用colcon编译ros的第三方package时指定Python路径即可。


colcon build --packages-select carlike_robot_description   --cmake-args    -DPython3_EXECUTABLE=/usr/bin/python3

/usr/bin/python3 是Linux系统默认的,安装ros时自动识别的,因此这里使用该路径。







file:///home/devil/Pictures/%E6%88%AA%E5%9B%BE/%E6%88%AA%E5%9B%BE%202026-08-14%2019-39-04.png图片







检查package是否编译成功:

file:///home/devil/Pictures/%E6%88%AA%E5%9B%BE/%E6%88%AA%E5%9B%BE%202026-08-14%2019-44-07.png图片




source install/setup.bash 
ros2 pkg prefix carlike_robot_description







具体报错:

[19:31]devil@Monster:/tmp/VLM-BehAV-Nav/robot_yang$ colcon build --packages-select carlike_robot_description
Starting >>> carlike_robot_description
--- stderr: carlike_robot_description
Traceback (most recent call last):
File "/opt/ros/jazzy/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 22, in
from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at /opt/ros/jazzy/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message):
execute_process(/home/devil/.local/bin/python3.13
/opt/ros/jazzy/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py
/tmp/VLM-BehAV-Nav/robot_yang/src/carlike_robot_description/package.xml
/tmp/VLM-BehAV-Nav/robot_yang/build/carlike_robot_description/ament_cmake_core/package.cmake)
returned error code 1
Call Stack (most recent call first):
/opt/ros/jazzy/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml)
/opt/ros/jazzy/share/ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake:31 (ament_package_xml)
CMakeLists.txt:23 (ament_lint_auto_find_test_dependencies)


Failed <<< carlike_robot_description [0.27s, exited with code 1]

Summary: 0 packages finished [0.42s]
1 package failed: carlike_robot_description
1 package had stderr output: carlike_robot_description

posted on 2026-08-14 19:40  Angry_Panda  阅读(3)  评论(0)    收藏  举报

导航