I am trying to use pygraphviz and networkx in python (v 2.7) to create a network map. I found a script that looks very useful on stackoverflow:
import netwo
There is probably more than one cause for this error, but if it is caused by a missing path to the graphviz modules [neato,dot,twopi,circo,fdp,nop]
, then there is one hack that worked for me. I'm currently asking what the correct solution is, but you can use this
if not 'C:\\Program Files (x86)\\Graphviz2.38\\bin' in os.environ["PATH"]:
os.environ["PATH"] += os.pathsep + 'C:\\Program Files (x86)\\Graphviz2.38\\bin'
at the beginning of your script. To generalize, if your graphviz files are saved somewhere else:
graph_path='your_bin_folder_path'
if not graph_path in os.environ["PATH"]:
os.environ["PATH"] += os.pathsep + graph_path
In particular, this worked on windows 10, using anaconda navigator and python version 3.7.