CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

错误如下

ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/home/jinxi/anaconda/yes/bin/python2
  "/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/melodic/share/catkin/cmake/../package.xml"
  "/home/jinxi/cat_ws/build/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/melodic/share/catkin/cmake/all.cmake:168 (_catkin_package_xml)
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:58 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jinxi/cat_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jinxi/cat_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

该错误提示是因为在代码中使用了 catkin_pkg库,但你的系统中没有安装这个库。

需要在终端中使用以下命令安装 catkin_pkg库:

$ pip install catkin_pkg

结果如下,则安装成功:

CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):_第1张图片

再重新创建文件即可运行成功。

希望能对你有所帮助!!!

你可能感兴趣的:(linux,运维,服务器,ubuntu,机器人)