4.2.1自定义服务接口,执行colcon build报错
-
报错内容如下:
~/chapt4/chapt4_ws$ colcon build
Starting >>> chapt4_interfaces
--- stderr: chapt4_interfaces
CMake Error at /opt/ros/humble/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:20 (find_package):
By not providing "FindPythonInterp.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"PythonInterp", but CMake did not find one.Could not find a package configuration file provided by "PythonInterp"
(requested version 3.6) with any of the following names:PythonInterpConfig.cmake pythoninterp-config.cmake
Add the installation prefix of "PythonInterp" to CMAKE_PREFIX_PATH or set
"PythonInterp_DIR" to a directory containing one of the above files. If
"PythonInterp" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
/opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:13 (rosidl_generate_interfaces)gmake: *** [Makefile:747:cmake_check_build_system] 错误 1
Failed <<< chapt4_interfaces [1.72s, exited with code 2]
Summary: 0 packages finished [1.81s]
1 package failed: chapt4_interfaces
1 package had stderr output: chapt4_interfaces开始提示Cmake版本<3.10怎么怎么的,于是我就改了CmakeList文件中第一行为:
cmake_minimum_required(VERSION 4.0)
就有了上面的报错,请问怎么处理?