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'
Plot tree is available after sklearn version > 0.21.
pip install --upgrade sklearn
could help but if it isn't you have to upgrade whole python version.
I had the same issue on 3.6.7 python and solve it by installing 3.7.7.
Install scikit-learn
Fix:
pip install scikit-learn
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.