Search code examples
pythonpython-3.xscikit-learnpip

ImportError: cannot import name 'plot_tree' from 'sklearn.tree'


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'

Solution

  • Install scikit-learn

    Fix:

    pip install scikit-learn