Reputation: 871
Import error when importing plot_tree from sklearn
after doing pip install sklearn
Error-Log:
from sklearn.tree import DecisionTreeClassifier, plot_tree
ImportError: cannot import name 'plot_tree' from 'sklearn.tree'
Upvotes: 1
Views: 9497
Reputation: 140
Plot tree is available after sklearn version > 0.21.
pip install --upgrade sklearn
could help but if it isn't you have to upgrade the whole python version.
I had the same issue on 3.6.7 python and solve it by installing 3.7.7.
Upvotes: 2