欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

cannot import name ‘six报错

程序员文章站 2022-04-25 20:08:57
...

这里写自定义目录标题


python使用imblearn报错,当我想导入SMOTE报错

D:\programfiles\Anaconda\envs\deepLearning\lib\site-packages\imblearn\base.py in 
     10 import numpy as np
     11 from sklearn.base import BaseEstimator
---> 12 from sklearn.externals import six
     13 from sklearn.utils import check_X_y
     14 from sklearn.utils.multiclass import type_of_target

ImportError: cannot import name 'six'
[6]

解决方案:
https://*.com/questions/61901365/modulenotfounderror-no-module-named-sklearn-externals-six
Downgrade your scikit-learn version:

In jupyter notebook try !pip install --upgrade scikit-learn==0.20.3

or in terminal try pip install --upgrade scikit-learn==0.20.3

After that the code will recognize the sklearn.external.six module.
也就是说目前的sklearn版本过高,导致不能使用
进行退级更新即可。

相关标签: 报错解决