AttributeError: module 'pydot' has no attribute 'quote_id_if_necessary'. Did you mean: 'quote_if_necessary'? error occurs when loading a dot graph file or running ROS -> Load current graph
[INFO ][ros2networkx.py:55] Analyzing...
[INFO ][dot2networkx.py:99] len(connected_nodes) = 100
[INFO ][graph_manager.py:98] 10 topics are removed by filter
[INFO ][graph_manager.py:102] 5 nodes are removed due to isolated
[INFO ][graph_manager.py:85] 0 nodes are removed by filter
Traceback (most recent call last):
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_view.py", line 310, in _cb_menu_graph_current
self.graph_viewmodel.load_running_graph()
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_viewmodel.py", line 68, in load_running_graph
self.graph_manager.load_graph_from_running_ros()
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_manager.py", line 57, in load_graph_from_running_ros
self.load_graph_from_dot('./temp.dot')
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_manager.py", line 50, in load_graph_from_dot
self.load_graph_postprocess(filename)
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_manager.py", line 72, in load_graph_postprocess
self.graph = place_node_by_group(self.graph, self.group_setting)
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_layout.py", line 51, in place_node_by_group
layout = place_node(graph, group_name)
File "~/.local/lib/python3.10/site-packages/dear_ros_node_viewer/graph_layout.py", line 105, in place_node
layout = nx.nx_pydot.pydot_layout(graph_modified, prog=prog)
File "~/.local/lib/python3.10/site-packages/networkx/drawing/nx_pydot.py", line 344, in pydot_layout
node = Q.get_node(pydot.quote_id_if_necessary(str_n))
AttributeError: module 'pydot' has no attribute 'quote_id_if_necessary'. Did you mean: 'quote_if_necessary'?
Environment
Ubuntu 22.04
ROS2 Humble
Python packages
dear_ros_node_viewer: 1.0.2
pydot: 1.4.2
networkx: 3.4.1
Cause
The issue is caused by the lack of compatibility between the versions used in the networkx package and the pydot package.
Issue
AttributeError: module 'pydot' has no attribute 'quote_id_if_necessary'. Did you mean: 'quote_if_necessary'?
error occurs when loading a dot graph file or runningROS
->Load current graph
Environment
Cause
The issue is caused by the lack of compatibility between the versions used in the networkx package and the pydot package.
Solution