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

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

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

manish.nayak gravatar image

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

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/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 349, in main
from .perspective_manager import PerspectiveManager
File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 44, in <module>
class PerspectiveManager(QObject):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", 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

Comments

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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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: https://github.com/ros-visualization/...

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

Comments

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 -0500 )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 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 517 times

Last updated: Jan 23 '17