详细错误信息如下:
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/wuming/anaconda3/bin/python3
"/opt/ros/noetic/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/noetic/share/catkin/cmake/../package.xml"
"/home/wuming/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
returned error code 1
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
/opt/ros/noetic/share/catkin/cmake/all.cmake:168 (_catkin_package_xml)
/opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:58 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/wuming/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/wuming/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
问题原因:主要是ROS的python版本和机器自身python版本不兼容(我的ubuntu使用的是 python 3.8.5)
解决办法:根据官网说明使用
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
解决问题
官网地址:http://wiki.ros.org/catkin/Tutorials/create_a_workspace