【问题标题】:how to import sklearn.impute on jupyter NoteBook?如何在 jupyter NoteBook 上导入 sklearn.impute?
【发布时间】:2020-07-01 10:20:05
【问题描述】:

在 jupyter 中从 sklearn 导入 impute 模块时遇到问题:

从 sklearn.impute 导入 SimpleImpute

到目前为止,我已经尝试了所有解决方案, 安装最新版本的 sklearn(0.23.1) 和 jupyter(6.0.3) 笔记本 但仍然有同样的错误

ModuleNotFoundError:没有名为“sklearn.impute”的模块

我已经在 IDLE 上尝试过相同的代码,没有问题 问题出在jupyter上

我该如何解决这个问题?

【问题讨论】:

    标签: python scikit-learn jupyter-notebook


    【解决方案1】:

    在 jupyter-notebook 中运行以下命令并验证版本 0.23scikit-learn 是否在列表中。如果它不在列表中,则意味着您的 IDLE 和 jupyter-notebook 正在使用不同的 python 安装。 (因为它在 IDLE 中工作)

    !pip list
    

    如果列表中缺少它,则使用直接从 jupyter-notebook 安装它

    !pip install --upgrade scikit-learn
    

    【讨论】:

    • 非常感谢。我检查了 Jupyter-notebook 上的版本,由于 python 安装的不同,版本没有改变,所以我在 jupyter 上更新了它
    猜你喜欢
    • 2021-01-18
    • 2019-03-20
    • 1970-01-01
    • 2023-03-29
    • 2020-10-31
    • 2021-11-02
    • 2017-06-14
    • 2016-12-15
    • 1970-01-01
    相关资源
    最近更新 更多