【发布时间】:2021-01-28 23:52:17
【问题描述】:
当我尝试在 Jupyter Notebook 上加载 from sklearn.impute import KNNImputer 时,它给了我以下错误。
ImportError: cannot import name 'KNNImputer' from 'sklearn.impute' (C:\Users\aura-\Anaconda3\lib\site-packages\sklearn\impute_init_.py)
我已将 sklearn 更新到最新版本。
(base) C:\Users\aura->pip install -U scikit-learn
Requirement already up-to-date: scikit-learn in c:\users\aura-\anaconda3\lib\site-packages (0.23.2)
但是当我再次查看 Jupyter Notebook import sklearn;print(sklearn.__version__) 时,它仍然显示 0.21.3
为什么更新没有反映在 Jupyter Notebook 上?
【问题讨论】:
-
还有其他python目录吗?(不是anaconda)
标签: python scikit-learn jupyter-notebook