I am not sure why I get an AttributeError: module 'graphviz.backend' has no attribute 'ENCODING'
when I tried to export regression tree to graphviz. I tried re-installing graphviz and sklearn but it doesn't solve the problem. Appreciate any advice on this.
AttributeError Traceback (most recent call last)
<ipython-input-4-9d9e0becf9b6> in <module>
3 # graphviz is the drawing tool
4 from sklearn.tree import export_graphviz
----> 5 import graphviz
6 dot_data = export_graphviz(
7 model,
C:\ProgramData\Anaconda3\lib\site-packages\graphviz\__init__.py in <module>
25 """
26
---> 27 from .dot import Graph, Digraph
28 from .files import Source
29 from .lang import escape, nohtml
C:\ProgramData\Anaconda3\lib\site-packages\graphviz\dot.py in <module>
30
31 from . import backend
---> 32 from . import files
33 from . import lang
34
C:\ProgramData\Anaconda3\lib\site-packages\graphviz\files.py in <module>
20
21
---> 22 class Base(object):
23
24 _engine = 'dot'
C:\ProgramData\Anaconda3\lib\site-packages\graphviz\files.py in Base()
26 _format = 'pdf'
27
---> 28 _encoding = backend.ENCODING
29
30 @property
AttributeError: module 'graphviz.backend' has no attribute 'ENCODING'