graph.write_pdf("iris.pdf") AttributeError: 'list' object has no attribute 'write_pdf'
I think you are using newer version of python. Please try with pydotplus.
import pydotplus
...
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
graph.write_pdf("iris.pdf")
This should do it.
pydot.graph_from_dot_data()
returns a list, so try:
graph = pydot.graph_from_dot_data(dot_data.getvalue())
graph[0].write_pdf("iris.pdf")
I had exactly the same issue. Turned out that I hadn't installed graphviz. Once i did that it started to work.