【问题标题】:Error while using catkin_make after creating a package创建包后使用 catkin_make 时出错
【发布时间】:2022-01-24 14:21:17
【问题描述】:

我在我的 ROS melodic Ubuntu-18.04 上使用 catkin_make 命令时遇到以下错误,同时从 http://wiki.ros.org/ROS/Tutorials/CreatingPackage 制作了一个名为beginner_tutorials 的包 '''

Base path: /home/kausshik/catkin_ws
Source space: /home/kausshik/catkin_ws/src
Build space: /home/kausshik/catkin_ws/build
Devel space: /home/kausshik/catkin_ws/devel
Install space: /home/kausshik/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/kausshik/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/kausshik/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.9", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/kausshik/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
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/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/usr/bin/python3
  "/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/melodic/share/catkin/cmake/../package.xml"
  "/home/kausshik/catkin_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/kausshik/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/kausshik/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

'''

【问题讨论】:

    标签: linux cmake ros


    【解决方案1】:

    Catkin 在你的机器上使用 Python 3,而 ROS melodic 只为 Python 2 安装所有东西。这就是为什么你必须为 Python 3 手动安装模块 catkin_pkg

    sudo apt install python3-catkin-pkg
    

    这里描述并解决了同样的问题: https://answers.ros.org/question/337135/catkin_make-no-module-named-catkin_pkg/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-19
      • 2018-04-19
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 2018-11-11
      • 2016-06-14
      相关资源
      最近更新 更多