Ask Your Question

rosrun rqt_graph rqt_graph shows error

asked 2017-02-21 06:59:50 -0500

Kfi gravatar image

Environment: ROS kinetic Ubuntu 16.04

ERROR: rosrun rqt_graph rqt_graph

Could not import "pyqt" bindings of qt_gui_cpp library - so C++ plugins will not be available: Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui_cpp/", line 43, in <module> import libqt_gui_cpp_sip ModuleNotFoundError: No module named 'libqt_gui_cpp_sip'

Traceback (most recent call last): File "/opt/ros/kinetic/lib/rqt_graph/rqt_graph", line 8, in <module> sys.exit(main.main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph')) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/", line 59, in main return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH']))) File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/", line 505, in main plugin = plugins.keys()[0]

TypeError: 'dict_keys' object does not support indexing!

image description

Could someone please tell me what exactly is going wrong here ? Thanks in advance!

edit retag flag offensive close merge delete


Exact same problem, please help.

steven gravatar image steven  ( 2017-04-14 09:52:49 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-04-19 05:32:42 -0500

You can use an alias in ubuntu

just edit the "~/.bashrc" or the "~/.bash_aliases" file and add: alias python3=python

Test it:

$ python --version
Python 2.7.12
$ python3 --version
Python 3.5.2


edit flag offensive delete link more

answered 2017-04-18 16:10:31 -0500

Jarno gravatar image

The problem is that rqt_graph and ROS in general seems still to be based on Python 2.7. In Python 2.7 the dict .keys() method returned a list, in Python 3 it returns a dict_keys object that cannot be indexed. On your system you seem to try to run rqt_graph with a Python 3 interpreter (which is I think the default in Ubuntu 16.04). My recommendation is to set up a conda environment with Python 2.7. You will most probably need to install some more Python dependencies, look out for ImportError when trying to run rqt_graph. Moreover, you need to source the environemnt in the terminal each time you run ROS. This can also be automated by simply writing source activate <envname> in your .bashrc or with tools like tmuxinator, which is quite handy for running multiple terminals at once, since that is often required when working with ROS anyway.

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



Asked: 2017-02-21 06:59:50 -0500

Seen: 2,164 times

Last updated: Apr 19 '17