pythonnetworkxgraphviz

Python NetworkX graphviz layout - RuntimeWarning about gvplugin_pango.dll dependencies


After installing pygraphviz via conda, and trying to create graph:

# graph: nx.DiGraph
pos = nx.nx_agraph.graphviz_layout(graph, prog='dot', ...)
# pos[node] ...

positions are calculated normally, but the next warning is shown:

agraph.py:1405: RuntimeWarning: Warning: Could not load "*\Library\bin\gvplugin_pango.dll" It was found, so perhaps one of its dependents was not. Try ldd.

Downgrade or upgrade graphwiz and pygraphwiz in Conda was not flexible, install via pip fails due to missing header 'graphviz/cgraph.h' (MSVS build).

Versions:
env: Python 3.8.19
conda pygraphviz: 1.9
conda graphviz: 3.0.0

Also noticed that but by the docs it appears to be that nx_agraph.graphviz_layout is close to nx.nx_pydot.pydot_layout, which does not cause a warning.
But a command line test of pydot command shows that the warning is still there, just not propagated into debug output.

What would be the proper way to fix the warning?


Solution

  • Warning was fixed with update to:
    env: Python 3.9.19
    conda pygraphviz: 1.11
    conda graphviz: 8.1.0