cmake 找不到ROS2 catkin_pkg(已安装并使用版本3.8)

anhgbhbe  于 2023-11-19  发布在  其他
关注(0)|答案(1)|浏览(223)

我使用moveit2 for panda构建了一个新的包,当我尝试colcon build时,我遇到了以下错误:

Traceback (most recent call last):
  File "/opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 22, in <module>
    from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message):
  execute_process(/usr/local/bin/python3.8
  /opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py
  /home/mikel/dualpandaWS/src/franka_moveit_config/package.xml
  /home/mikel/dualpandaWS/build/franka_moveit_config/ament_cmake_core/package.cmake)
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:63 (ament_package_xml)
  CMakeLists.txt:6 (ament_package)

字符串
我已经搜索了interent并尝试了sudo apt install python3-catkin-pkgsudo update-alternatives --config python,看看我使用的是什么python版本,它返回:

There is only one alternative in link group python (providing /usr/bin/python): /usr/bin/python3.8
Nothing to configure


我不知道我能做些什么来解决这个问题,似乎我缺乏某种配置,所以我可以建立我的工作区.任何帮助,请?

zzlelutf

zzlelutf1#

确保你安装了Colcon:

sudo apt install python3-colcon-common-extensions

字符串
rosdep也可以帮助你安装依赖项:

rosdep update
rosdep install --from-paths src -y --ignore-src


同时确保你的源代码是你的ros2环境(你似乎已经这样做了,但只是以防万一)。
除此之外,你的问题似乎类似于this在这种情况下,

pip install catkin_pkg

相关问题