当前位置: 代码迷 >> 综合 >> Could not find a package configuration file provided by “rospy“ with any of the following names:报错
  详细解决方案

Could not find a package configuration file provided by “rospy“ with any of the following names:报错

热度:60   发布时间:2023-12-03 10:21:37.0

我在跟着ROS Tutorials学习初级教程的第三步创建ROS软件包的过程中,遇到了catkin_make命令一直报错:

从具体的报错信息来看,它给出的原因是缺少rospy软件包:

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):Could not find a package configuration file provided by "rospy" with any ofthe following names:rospyConfig.cmakerospy-config.cmakeAdd the installation prefix of "rospy" to CMAKE_PREFIX_PATH or set"rospy_DIR" to a directory containing one of the above files.  If "rospy"provides a separate development package or SDK, be sure it has beeninstalled.

解决办法(将noetic换成对应的ROS版本):

sudo apt-get install ros-noetic-rospy

再运行catkin_make就没有报错了。

        如果这种办法是一次性的,下次还会报错的话,我的解决办法是重新安装完整桌面版ROS,它会补全所缺失的文件(不会像第一次下载ROS那样慢,因为它只会下载缺失的文件):

sudo apt install ros-noetic-desktop-full

  相关解决方案