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.
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.