Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named pydot ( unable to import pydot)

I am unable to import the pydot package in Spyder, Could you please help me out is there any other way to import it. I need it for decision tree visualization. The statement

import pydot

is not working.

like image 274
Sanchit Aluna Avatar asked Feb 03 '16 12:02

Sanchit Aluna


People also ask

What is Pydot in Python?

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."[ 1]


1 Answers

pip install pydot
pip install graphviz

there is a similar problemm: Keras: "RuntimeError: Failed to import pydot." after installing graphviz and pydot

pip installs pydot, but not GraphViz. The GraphViz binary files (dot, neato, etc.) need to be downloaded and installed separately from pydot. In addition, the location of these executables should be added to the $PATH environment variable (or equivalent in your operating system). Otherwise pydot won't find dot when looking in directories included in the current path.

like image 122
Eugenie Avatar answered Sep 28 '22 02:09

Eugenie