Colcon 构建失败,rclpy
尝试 Colcon 构建 ROS2 Rolling (https://docs.ros .org/en/rolling/Installation/Ubuntu-Development-Setup.html),我遇到了这个错误:
colcon build --symlink-install
Starting >>> rclpy
--- stderr: rclpy
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS
Development) (found version "3.9.10")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindPython/Support.cmake:2214 (find_package_handle_standard_args)
/usr/share/cmake-3.16/Modules/FindPython3.cmake:300 (include)
CMakeLists.txt:40 (find_package)
---
Failed <<< rclpy [5.33s, exited with code 1]
我的系统Python是3.8.10,我的系统Ubuntu 20.04。 从日志来看,似乎没有找到 3.8,而选择了 3.9(我的系统上也安装了 3.9)。其他 300 个左右的 ROS2 Rolling 软件包安装没有问题。
Trying to Colcon build ROS2 Rolling (https://docs.ros.org/en/rolling/Installation/Ubuntu-Development-Setup.html), I've faced this error:
colcon build --symlink-install
Starting >>> rclpy
--- stderr: rclpy
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS
Development) (found version "3.9.10")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindPython/Support.cmake:2214 (find_package_handle_standard_args)
/usr/share/cmake-3.16/Modules/FindPython3.cmake:300 (include)
CMakeLists.txt:40 (find_package)
---
Failed <<< rclpy [5.33s, exited with code 1]
My system Python is 3.8.10, my system Ubuntu 20.04.
From the logs, it looks like 3.8 is not being found, while 3.9 is picked instead (3.9 is installed too on my system). The other 300s or so packages of ROS2 Rolling installed without issues.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信该错误是由于 colcon 选择了 anaconda python,而不是默认的操作系统 python(在我的例子中是 3.8.10)。
https://docs.ros.org/en/rolling/How-To-Guides/Installation-Troubleshooting.html#import-failing-without-library-present-on-the-system
I believe the error was due to colcon picking up the anaconda python, instead of the default OS python (3.8.10 in my case).
https://docs.ros.org/en/rolling/How-To-Guides/Installation-Troubleshooting.html#import-failing-without-library-present-on-the-system