ModuleNotFoundError: No module named 'sklearn.impute'
from sklearn.impute import SimpleImputer会报错
报错原因是安装的sklearn版本为0.19,而它需要0.20以上版本,所以需要进行更新
在Anaconda prompt中输入:
pip install --upgrade scikit-learn==0.22.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
会报错,拒绝访问。需要在最后加--user,赋予权限
pip install --upgrade scikit-learn==0.22.0 -i https://pypi.tuna.tsinghua.edu.cn/simple --user
这样做还会报错,因为安装了两个版本的numpy,需要删除
pip uninstall numpy
可以看到有两个numpy需要删除
然后重新安装numpy
pip install numpy
最后重新启动jupyter