k-okada / break_rqt_graph

0 stars 0 forks source link

rqt_graph not working on indigo before doing anything #1

Open asmodehn opened 7 years ago

asmodehn commented 7 years ago

I just did :

alexv@AlexV-Linux:~/Projects$ source /opt/ros/indigo/setup.bash 
alexv@AlexV-Linux:~/Projects$ rqt_graph 
Couldn't import dot_parser, loading of dot files will not be possible.
PluginHandlerDirect._restore_settings() plugin "rqt_graph/RosGraph#0" raised an exception:
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 116, in _restore_settings
    self._plugin.restore_settings(plugin_settings_plugin, instance_settings_plugin)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 203, in restore_settings
    self._refresh_rosgraph()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 227, in _refresh_rosgraph
    self._update_graph_view(self._generate_dotcode())
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 260, in _update_graph_view
    self._redraw_graph_view()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 293, in _redraw_graph_view
    same_label_siblings=True)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/qt_dotgraph/dot_to_qt.py", line 234, in dotcode_to_qt_items
    graph = pydot.graph_from_dot_data(dotcode.encode("ascii", "ignore"))
  File "/usr/lib/python2.7/dist-packages/pydot.py", line 220, in graph_from_dot_data
    return dot_parser.parse_dot_data(data)
NameError: global name 'dot_parser' is not defined

So I started digging :

alexv@AlexV-Linux:~/Projects$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydot
Couldn't import dot_parser, loading of dot files will not be possible.
>>> pydot.__file__
'/usr/lib/python2.7/dist-packages/pydot.pyc'

So in my case pydot in ubuntu trusty doesnt have dot_parser available by default. After a bit of googling I found out that the pyparsing package could be the cause.

alexv@AlexV-Linux:~/Projects$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyparsins
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pyparsins
>>> import pyparsing
>>> pyparsing.__file__
'/usr/local/lib/python2.7/dist-packages/pyparsing.pyc'
>>> 
alexv@AlexV-Linux:~/Projects$ sudo pip deinstall pyparsing
ERROR: unknown command "deinstall" - maybe you meant "install"
alexv@AlexV-Linux:~/Projects$ sudo pip duninstall pyparsing
ERROR: unknown command "duninstall" - maybe you meant "uninstall"
alexv@AlexV-Linux:~/Projects$ sudo pip uninstall pyparsing
Uninstalling pyparsing:
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/DESCRIPTION.rst
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/METADATA
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/RECORD
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/WHEEL
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/metadata.json
  /usr/local/lib/python2.7/dist-packages/pyparsing-2.2.0.dist-info/top_level.txt
  /usr/local/lib/python2.7/dist-packages/pyparsing.py
  /usr/local/lib/python2.7/dist-packages/pyparsing.pyc
Proceed (y/n)? y
  Successfully uninstalled pyparsing
alexv@AlexV-Linux:~/Projects$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydot
>>> pydot.__version__
'1.0.28'
>>> pydot.__file__
'/usr/lib/python2.7/dist-packages/pydot.pyc'

So my recent pyparsing (2.2.0) was not working with my old pydot (1.0.28).

I found a few issues related to that, especially : https://github.com/erocarrera/pydot/issues/81

asmodehn commented 7 years ago

I recently thought about a few other things you need to know :