2

I am trying to visualize my network. While there is no error in installing and importing the pydotplus and networkx.drawing.nx_pydot import graphviz_layout, when I try to draw it, I am receiving the error below.

FileNotFoundError: [WinError 2] "neato" not found in path.

How can I fix this?

Funky
  • 91
  • 1
  • 6
  • Did you install Graphviz on your machine? – vurmux Jun 19 '19 at 16:24
  • Yes I've also installed Graphviz and Pygraphviz – Funky Jun 19 '19 at 16:25
  • 1
    Sometimes `pydot` works bad for me. Try to use `agraph` in `networkx`, maybe it will help you. – vurmux Jun 19 '19 at 16:28
  • I tried it and its giving me an error of ImportError: ('requires pygraphviz ', 'http://pygraphviz.github.io/') so I tried installing it again, and it gives me an PackagesNotFoundError for some reason – Funky Jun 19 '19 at 16:33
  • Something is wrong with your packages... Sorry, I can't help you, I mostly use Graphviz on Linux. – vurmux Jun 19 '19 at 16:56
  • Ok thanks. Just a last question. Do you happen to know a remedy for this error AssertionError: 1 "neato" with args ['-Tdot', ] returned code: 1 – Funky Jun 19 '19 at 17:24
  • `dot` is another program from Graphviz. `-T` is the output format of a graph, like `-Tpng`, `-Tsvg` or `-Tdot` (returns DOT file). Looks like you have an incorrect graph that can't be parsed with `neato`. – vurmux Jun 19 '19 at 17:30
  • But I was able to display the graph using the normal spring_layout – Funky Jun 19 '19 at 17:36
  • Because spring_layout doesn't use `Graphviz`, it is the part of `networkx` – vurmux Jun 19 '19 at 19:24

1 Answers1

0

If you want to do this without additional libraries, look at this answer, which shows a way to get a hierarchical tree layout or a circular layout purely in networkx:

https://stackoverflow.com/a/29597209/2966723