【问题标题】:Can't find any error in sklearn installation in ubuntu在ubuntu中找不到sklearn安装的任何错误
【发布时间】:2020-02-02 01:18:54
【问题描述】:

我已经使用命令“sudo apt-get install python-sklearn”安装了 scikit-learn。但我收到 ModuleNotFoundError。我的安装有什么问题?

import numpy as np
import matplotlib.pyplot as plt
import sklearn
from sklearn import linear_model

错误显示如下-

ModuleNotFoundError Traceback(最近一次调用最后一次)

<ipython-input-3-413e8e9f65e9> in <module>
      1 import numpy as np
      2 import matplotlib.pyplot as plt
----> 3 import sklearn
      4 from sklearn import linear_model

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

【问题讨论】:

    标签: python scikit-learn deep-learning ubuntu-18.04


    【解决方案1】:

    sklearn 模块未安装。

    用途:

    pip install -U scikit-learn
    

    或康达:

    conda install scikit-learn
    

    【讨论】:

      【解决方案2】:

      你应该通过pip安装sklearn,意思是pip install scikit-learn

      【讨论】:

      • 我也在用docker打开jupyter notebook
      猜你喜欢
      • 2020-05-23
      • 2012-05-20
      • 2020-10-20
      • 1970-01-01
      • 1970-01-01
      • 2016-11-16
      • 2017-11-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多