When I run a very simple code with pydot
import pydot graph = pydot.Dot(graph_type=\'graph\') for i in range(3): edge = pydot.Edge(\"king\", \"lord%d\" %
$ sudo pip uninstall pydot
$ sudo pip install pydot2
See the following link: http://infidea.net/troubleshooting-couldnt-import-dot_parser-loading-of-dot-files-will-not-be-possible/