Ubuntu20.04 出现 Could not find a package configuration file provided by “boost_python3“的参考解决方法

写在前面

笔者的环境:
Ubuntu 20.04,ROS-noetic.
下面是自己的解决方法,供朋友们参考。

一、问题描述

自己是在编译ROS程序时,其中该程序涉及到vision_opencv/cv_bridge,出现如下报错:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_python3"
  (requested version 1.71.0) with any of the following names:

    boost_python3Config.cmake
    boost_python3-config.cmake

  Add the installation prefix of "boost_python3" to CMAKE_PREFIX_PATH or set
  "boost_python3_DIR" to a directory containing one of the above files.  If
  "boost_python3" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package)
  CMakeLists.txt:17 (find_package)

报错截图如下:
在这里插入图片描述

二、解决方法

出现这种情况的原因主要是

修改方法:
vision_opencv/cv_bridge/CMakeLists.txt 中的如下语句:

if(NOT ANDROID)
  find_package(PythonLibs)
  if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
    find_package(Boost REQUIRED python)
  else()
    find_package(Boost REQUIRED python3)
  endif()
else()
find_package(Boost REQUIRED)
endif()

修改为:

if(NOT ANDROID)
  find_package(PythonLibs)
  # if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
    find_package(Boost REQUIRED python)
  # else()
  #   find_package(Boost REQUIRED python3)
  # endif()
else()
find_package(Boost REQUIRED)
endif()

参考链接

[1] ethz-asl/maplab. Error with boost dependency #368 [EB/OL]. https://github.com/ethz-asl/kalibr/issues/368, 2021-03-02/2023-01-16.
[2] (该博客的方法自己试验未成功) 飞同学. boost_python3 [EB/OL]. https://blog.csdn.net/z1872385/article/details/124782647, 2022-05-15/2023-01-16.

  • 9
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在提到 "Could not find a package configuration file provided by 'transform_common'" 这个错误时,引用了和。这个错误意味着系统无法找到名为 "transform_common" 的软件包的配置文件。 为了解决这个问题,你可以尝试以下几种方法: 1. 确保正确安装了所需的软件包:首先,你需要确保已经安装了名为 "transform_common" 的软件包。可以使用系统包管理器来安装该软件包,具体命令可能因操作系统而异。如果没有找到该软件包,请查看是否有其他名称的软件包提供了相同的功能。 2. 更新软件包索引:有时,你的系统可能没有最新的软件包索引。你可以运行以下命令来更新软件包索引:sudo apt update 3. 检查软件源设置:如果你使用的是自定义软件源,请确保软件源的设置正确并包含所需的软件包。 4. 查找软件包的其他来源:如果无法在系统默认的软件源中找到所需的软件包,你可以尝试在其他软件源中查找。这些软件源可以是第三方提供的,或者你可以在互联网上找到。 需要注意的是,这些解决方法是基于常见情况的推测,具体解决方法可能因你的操作系统和软件配置而有所不同。因此,建议你参考操作系统的官方文档或在相关技术社区中寻求更具体的帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [安装cartographer出现的问题及解决方法](https://blog.csdn.net/c417469898/article/details/117259009)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Linux(Ubuntu20.04) complie opencv with Qt, OpenGL, VTK,cuda](https://blog.csdn.net/weixin_42177582/article/details/121327915)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值