ros-visualization / rqt_graph

http://wiki.ros.org/rqt_graph
26 stars 27 forks source link

ImportError: No module named pydot | rqt_graph #25

Closed 0novanta closed 5 years ago

0novanta commented 5 years ago

I'm running ROS Kinetic on Fedora 29. Running rqt_graph command gives the following warning (not fatal I guess) and error (fatal):

Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
   QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
   QT_SCREEN_SCALE_FACTORS to set per-screen factors.
   QT_SCALE_FACTOR to set the application global scale factor.
RosPluginProvider.load(rqt_graph/RosGraph) exception raised in __builtin__.__import__(rqt_graph.ros_graph, [RosGraph]):
Traceback (most recent call last):
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rqt_gui/ros_plugin_provider.py", line 80, in load
    module = __builtin__.__import__(attributes['module_name'], fromlist=[attributes['class_from_class_type']], level=0)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rqt_graph/ros_graph.py", line 45, in <module>
    from qt_dotgraph.dot_to_qt import DotToQtGenerator
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_dotgraph/dot_to_qt.py", line 36, in <module>
    import pydot
ImportError: No module named pydot

PluginManager._load_plugin() could not load plugin "rqt_graph/RosGraph":
Traceback (most recent call last):
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_gui/plugin_handler.py", line 99, in load
    self._load()
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_gui/plugin_handler_direct.py", line 54, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rqt_gui_py/ros_py_plugin_provider.py", line 60, in load
    return super(RosPyPluginProvider, self).load(plugin_id, plugin_context)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/home/Giuseppe/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rqt_gui/ros_plugin_provider.py", line 86, in load
    raise e
ImportError: No module named pydot

I've installed both pydot and graphviz libraries through dnf command. No idea how to solve.

dirk-thomas commented 5 years ago

According to the error message pydot is not installed correctly. You can reproduce this by running python -c "import pydot; print(pydot.__file__)" (which I expect to fail with an ImportError). If the command does pass you might want to check the printed path if that refers to Python 2.7.

Since there is nothing wrong in this repository I am going to close this ticket. Feel free to continue commenting.

0novanta commented 5 years ago

You are correct, it gives the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pydot

Should I dnf erase it and then dnf install it again?

dirk-thomas commented 5 years ago

I have no idea what dnf does since I have never used Fedora. You might want to double check what files it actually installs and if they are for Python 2.7 and on the PYTHONPATH.

0novanta commented 5 years ago

@dirk-thomas thank you! The problem was that I had installed python3-pydot but it needed python2-pydot as you suggested in you answer.