I'm having trouble running Python's pydot on Windows 7.
I installed pydot with: conda install -c rmg pydot=1.2.2
I have graphviz installed under ../Program Files (x86)/Graphviz2.38/
When I run the following script I get an error saying
"dot.exe" not found in path
import pydot graph = pydot.Dot(graph_type='digraph') node_a = pydot.Node("Node A", style="filled", fillcolor="red") node_b = pydot.Node("Node B", style="filled", fillcolor="green") node_c = pydot.Node("Node C", style="filled", fillcolor="#0000ff") node_d = pydot.Node("Node D", style="filled", fillcolor="#976856") graph.add_node(node_a) graph.add_node(node_b) graph.add_node(node_c) graph.add_node(node_d) graph.add_edge(pydot.Edge(node_a, node_b)) graph.add_edge(pydot.Edge(node_b, node_c)) graph.add_edge(pydot.Edge(node_c, node_d)) graph.add_edge(pydot.Edge(node_d, node_a, label="and back we go again", labelfontcolor="#009933", fontsize="10.0", color="blue")) graph.write_png('example2_graph.png') Exception: "dot.exe" not found in path.
I have tried this solution: Permanently adding a file path to sys.path in Python, by adding the my-paths.pth
file with a line pointing to ../Graphiv2.38/bin/
where the dot.exe
file is located. But I still get the error.
What else can I try?
Type conda install pydot graphviz in cmd, and then add the executables location directory C:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz to your system path variable. That works! It works!
Pydot is a Python library, also written in Python, that "serves as a graphical interface to Graphviz, an open source graph visualization software. GraphViz is written in DOT language, but Pydot provides the ability to parse and dump data, between Python and DOT."[
0-win64.exe. If you are using Anaconda, then try running the below commands. Add the Graphviz installed location path to the PATH variable. Once the path is added, restart the system.
I followed the instructions given in this blog.
Then I installed graphviz from here and added C:\Program Files (x86)\Graphviz2.38\bin to PATH
.
Next I did:
conda install pydot-ng
And finally in my notebook I added the two lines below.
import os os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'
Type conda install pydot graphviz
in cmd, and then add the executables location directory C:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz
to your system path variable. That works!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With