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

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

Could not find a package configuration file provided by “rospy“ with any of the following names:报错_第1张图片

从具体的报错信息来看,它给出的原因是缺少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 of
  the following names:

    rospyConfig.cmake
    rospy-config.cmake

  Add 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 been
  installed.

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

sudo apt-get install ros-noetic-rospy

再运行catkin_make就没有报错了。

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

sudo apt install ros-noetic-desktop-full

你可能感兴趣的:(自动驾驶,ubuntu)