title: how to resolve AttributeError: module 'graphviz.backend' has no attribute 'ENCODING'
body: <p>I am not sure why I get an <code>AttributeError: module 'graphviz.backend' has no attribute 'ENCODING'</code> 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.</p>
  <hr />
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-4-9d9e0becf9b6&gt; in &lt;module&gt;
        3 # graphviz is the drawing tool
        4 from sklearn.tree import export_graphviz
  ----&gt; 5 import graphviz
        6 dot_data = export_graphviz(
        7     model,
  
  C:\ProgramData\Anaconda3\lib\site-packages\graphviz\__init__.py in &lt;module&gt;
       25 &quot;&quot;&quot;
       26 
  ---&gt; 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 &lt;module&gt;
       30 
       31 from . import backend
  ---&gt; 32 from . import files
       33 from . import lang
       34 
  
  C:\ProgramData\Anaconda3\lib\site-packages\graphviz\files.py in &lt;module&gt;
       20 
       21 
  ---&gt; 22 class Base(object):
       23 
       24     _engine = 'dot'
  
  C:\ProgramData\Anaconda3\lib\site-packages\graphviz\files.py in Base()
       26     _format = 'pdf'
       27 
  ---&gt; 28     _encoding = backend.ENCODING
       29 
       30     @property
  
  AttributeError: module 'graphviz.backend' has no attribute 'ENCODING'
  </code></pre>