Ask Your Question

Error when running rqt_graph. No module named "error"

asked 2020-02-27 09:04:40 -0500

KSJ gravatar image

updated 2020-02-27 13:39:36 -0500

gvdhoorn gravatar image

I'm running my model on ROS melodic.

Followed this tutorial to watch my dynamic graph of topics and nodes:

when I run rosrun rqt_graph rqt_graph I get an error:

File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/", line 42, in <module>
    import rospkg
ModuleNotFoundError: No module named 'rospkg'

In order to fix it I changed my PYTHONPATH as it suggested to do in this issue: (But I don't use anaconda though)

Then I got another error:

File "/usr/lib/python2.7/dist-packages/yaml/", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'

How can I fix that?

EDIT: I figured out that it is related to python version, I use python3.7.6 What version should I use instead? I tried 2.7.13 and it did not help

edit retag flag offensive close merge delete


If you use Python 3 you should install the Debian package python3-rospkg-modules. But note: ROS Melodic does not officially support Python 3 but only Python 2.7. When using Python 2.7 you should have the Debian package python-rospkg installed.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-02-28 10:44:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-31 11:34:36 -0500

KSJ gravatar image

This error occurred because I used wrong version of python.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-27 09:04:40 -0500

Seen: 240 times

Last updated: Mar 31 '20