catkin 构建编译失败

catkin build fails to compile

我正在尝试为 ROS 包中的示例教程编译构建文件。以下显示在终端中,

Errors     << catkin_tools_prebuild:cmake /home/comet/mybot_ws/logs/catkin_tools_prebuild/build.cmake.009.log
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/home/comet/anaconda3/bin/python
  "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
  "/home/comet/mybot_ws/build/catkin_tools_prebuild/catkin/catkin_generated/version/package.cmake")
  returned error code No such file or directory
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:4 (find_package)

它似乎正在尝试访问 anaconda3 文件夹中的 python 编译器,但我最近将其卸载了。有什么想法可以修改文件以使其指向 /usr/bin python 吗?任何想法表示赞赏。非常感谢!

最近刚解决,我在catkin build之前执行过catkin clean

所以你的环境被污染有两种可能

  1. 您的 PATH 变量仍然因指向您的 anaconda 位置而受到污染。请参阅 以供参考并删除 anaconda 条目。不要忘记打开一个新终端来应用更改
  2. 在获取 anaconda 环境的同时,您已经创建了本地 catkin 工作区。因此,您只需要删除当前工作区中的 builddevel,然后从头开始重建所有内容。

一个接一个地处理这两个步骤应该可以解决问题。