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版本过高,导致不能使用
进行退级更新即可。
上一篇: ios SnapKit 约束Unable to simultaneously satisfy constraints 和UIView-Encapsulated-Layout-Height的警告
下一篇: float和position
推荐阅读
-
pycharm读取图片,提示ImportError: cannot import name imread解决方法
-
ImportError: cannot import name 'cross_validation' from 'sklearn'
-
【案例分析】创建表报错误261: Cannot create file for table table-name.
-
cannot import name 'Flask' from 'flask'
-
ES6 - 报错整理(2): Uncaught SyntaxError: Cannot use import statement outside a module
-
ImportError: cannot import name 'Optional'
-
Python中使用Enum类时出现cannot import name ‘Enum‘ from partially initialized module ‘enum‘
-
前端报错:Cannot read property 'name' of null
-
Error “Cannot find module 'import-local'”报错
-
cannot import name ‘Graph‘ from ‘pyecharts‘