I tried to follow this instruction on Github to install and import the dtreeviz library.
When I run the where dot
and dot -V
command both seem to work fine as you can see here Lines in Windows Terminal.
However when I try to import dtreeviz in Python (Anaconda, version 3.6.5) I get the following error:
from dtreeviz.trees import *
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-fd764fe550c7> in <module>()
1 from sklearn import tree
----> 2 from dtreeviz.trees import *
C:\Users\marcb\Anaconda3\lib\site-packages\dtreeviz\trees.py in <module>()
6 from pathlib import Path
7 from sklearn import tree
----> 8 from graphviz.backend import run, view
9 import matplotlib.pyplot as plt
10 from dtreeviz.shadow import *
ImportError: cannot import name 'run'
I hope that someone can help me as I want to use this library to visualize single trees in Python and this library offers much more features than the original graphviz package.
Note: This is my first post on Stackoverflow, so feedback on this is also welcome.
I don't know if you are still looking for an awser, but i had exactly the same problem and fixed it this way:
In ~/.local/lib/python3.8/site-packages/dtreeviz/trees.py'
i replaced the line79: execute(' '.join(cmd), capture_output=True, check=True, quiet=False)
by79: os.system(' '.join(cmd))
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With