小编Ava*_*dav的帖子

导入错误:没有模块名称 sklearn.external.six

我目前正在使用 anaconda 4.8.3,想要显示决策树图,我已经在 anaconda 中安装了 graphviz 和 pydotplus 库,而不是这个我收到错误“ModuleNotFoundError:没有名为“sklearn.externals.six”的模块。这是我的代码:

from sklearn.tree import DecisionTreeClassifier
from IPython.display import Image  
from sklearn.externals.six import StringIO  
from sklearn.tree import export_graphviz
import pydot 
features = list(df.columns[1:])
features
Run Code Online (Sandbox Code Playgroud)

这是我的错误:

ModuleNotFoundError   Traceback (most recent call last)
<ipython-input-19-0b3416ce7fda> in <module>

        1 from IPython.display import Image
--->    2 from sklearn.externals.six import StringIO
        3 from sklearn.tree import export_graphviz
        4 import pydot
        5 ModuleNotFoundError: No module named 'sklearn.externals.six'
Run Code Online (Sandbox Code Playgroud)

python machine-learning scikit-learn anaconda

2
推荐指数
1
解决办法
8384
查看次数

标签 统计

anaconda ×1

machine-learning ×1

python ×1

scikit-learn ×1