ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rosrun rqt_graph rqt_graph shows error NameError: name 'basestring' is not defined

asked 2017-01-22 06:42:49 -0600

manish.nayak gravatar image

updated 2017-01-22 11:54:07 -0600

I have started the tutorials and when I try to run rqt_graph it gives me a basestring error. Can someone please help me how to proceed?

I am using Ubuntu 16.04, and Kinetic distro.

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 349, in main
from .perspective_manager import PerspectiveManager
File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/", line 44, in <module>
class PerspectiveManager(QObject):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/", line 48, in PerspectiveManager
perspective_changed_signal = Signal(basestring)
NameError: name 'basestring' is not defined

Is this what you were asking for?

EDIT:- I thought of proceeding for the time being, but I get same error on running rqt_console rqt_console; also in rqt_plot rqt_plot. Maybe the problem is in rqt package?

edit retag flag offensive close merge delete


There is probably a multi-line stacktrace associated with that error. Could you include that in your post? Please edit your question and use the Preformatted Text button to format things properly (it's the one with 101010 on it).

gvdhoorn gravatar image gvdhoorn  ( 2017-01-22 07:16:42 -0600 )edit

A quick google search suggests that this may be an incompatibility with trying to run python2 code in python3. Have you modified your system in some way to make python3 the default?

ahendrix gravatar image ahendrix  ( 2017-01-22 13:23:54 -0600 )edit

Yes you are right. I have installed anaconda for python, which sets python 3.5.2 as default. What should i do then?

manish.nayak gravatar image manish.nayak  ( 2017-01-22 23:20:50 -0600 )edit

Maybe the problem is in rqt package?

No, the problem is (trying to) us(e)(ing) Python 3.x with code that is written for 2.x, as @ahendrix wrote in his comment.

gvdhoorn gravatar image gvdhoorn  ( 2017-01-23 01:32:32 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-01-23 01:55:25 -0600

ahendrix gravatar image

Given Ubuntu's (and therefore ROS's) long-term goal of python3 compatibility, you should probably report this as a bug in the the qt_gui package:

Depending on how python-savvy you are, and how long you want to wait for a fix, there are at least a few ways to proceed:

  • Wait for the upstream maintainers to fix the python3 compatibility bug. Since this doesn't affect any other users, and doesn't affect the default configuration, this may take a while.
  • If you know python well, you can attempt to fix the bug yourself and submit it as a pull request.
  • Uninstall switch the default version of python back to python 2.7, without anaconda
  • I'm not very familiar with Anaconda, but I've seen a few posts indicating that, with some effort, it can be made to work. This suggests that there's a version of Anaconda for python 2.7 that may be more compatible.
edit flag offensive delete link more


Ok, I would definitely report the bug. I have just basic knowledge of python so I don't think fixing the bug by myself is feasible. On the other hand Anaconda is really handy and contains quite a few packages which I frequently use. Maybe un-installing it and installing the 2.7 version would be good

manish.nayak gravatar image manish.nayak  ( 2017-01-23 03:44:38 -0600 )edit

Although the division in python 2 is what I wanted to avoid. But that can be fixed using from_future_import division right? because I have codes already written in python 3.

manish.nayak gravatar image manish.nayak  ( 2017-01-23 03:47:36 -0600 )edit

Question Tools



Asked: 2017-01-22 06:42:49 -0600

Seen: 486 times

Last updated: Jan 23 '17