Ask Your Question
3

rosrun rqt_graph rqt_graph shows error

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

Kfi gravatar image

http://wiki.ros.org/ROS/Tutorials/Und...

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/cpp_binding_helper.py", 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/main.py", 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/main.py", 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

Comments

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
1

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

enjoy!

edit flag offensive delete link more
0

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

3 followers

Stats

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

Seen: 2,164 times

Last updated: Apr 19 '17