ModuleNotFoundError: No module named 'sklearn.impute'


(~ ̄▽ ̄)~

当我在 jupyter notebook 输入 from sklearn.impute import SimpleImputer 是它报错显示:

ModuleNotFoundError: No module named 'sklearn.impute'

原因

  • 可能是因为自己的 scikit-learn 库版本太低,需要将其更新到 0.20 版本或以上。

查看安装包

  • 在 anaconda prompt 输入pip listconda list 后回车,可查看已经安装的包。

更新包

  • 指定版本更新
pip install --upgrade scikit-learn==0.22.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/

tips:这里使用的是清华镜像源。

安装包

  • 倘若没有 scikit-learn 库
pip install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple/

✿✿ヽ(°▽°)ノ✿


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM