原因:
sklearn.externals.six 模块在 scikit-learn 0.23 及以后的版本已经被删除。
解决方法一
无需降级 scikit-learn。直接安装six包:
pip install six
然后直接引入即可:
from six import StringIO
解决方法二
降级scikit-learn 到版本0.22或更低版本。
在 jupyter notebook 中:
!pip install --upgrade scikit-learn0.20.3
在terminal:
pip install --upgrade scikit-learn0.20.3
尝试使用国内镜像进行,例如
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
scikit-learn 0.23版本及以上不再包含sklearn.externals.six模块。解决方法包括安装six库或者降级scikit-learn到0.22或更低版本。建议使用国内镜像源加速安装或升级过程。
9726





