ROS中执行rosrun rqt_graph报错 No module named 'rospkg'

环境:ubuntu18.04 + ROS Melodic
执行命令ros run rqt_graph rqt_graph报错:

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/rqt_graph/rqt_graph", line 5, in 
    from rqt_gui.main import Main
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_gui/main.py", line 38, in 
    import rospy
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in 
    from .client import spin, myargv, init_node, \
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/client.py", line 52, in 
    import roslib
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in 
    from roslib.launcher import load_manifest
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in 
    import rospkg
ModuleNotFoundError: No module named 'rospkg'

安装rospkg包:

pip install rospkg

安装完成后再次运行ros run rqt_graph rqt_graph,继续报错No module named ‘pydot’,
安装pydot:

pip install pydot

安装成功后,运行ros run rqt_graph rqt_graph后:
ROS中执行rosrun rqt_graph报错 No module named 'rospkg'_第1张图片

参考博文

ROS执行rosrun rqt_graph报错No module named ‘catkin_pkg’

你可能感兴趣的:(Linux,Ubuntu,ROS)