尝试导入sklearn时出错

时间:2017-12-21 00:43:55

标签: python machine-learning scikit-learn

   Traceback (most recent call last):
  File "project.py", line 2, in <module>
    import sklearn
  File "/usr/local/lib/python3.6/site-packages/sklearn/__init__.py", line 134, in <module>
    from .base import clone
  File "/usr/local/lib/python3.6/site-packages/sklearn/base.py", line 11, in <module>
    from scipy import sparse
ModuleNotFoundError: No module named 'scipy'

我已经安装了sklearn软件包,但每当我尝试使用import sklearn运行脚本时,我都会遇到这些错误。

终端告诉我它已安装。

Requirement already satisfied: sklearn in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.6/site-packages (from sklearn)

1 个答案:

答案 0 :(得分:0)

您只是错过了[Display(Name = "MyResourceName", ResourceType = typeof(Resources.MyResources))] 的其他要求。您只需运行scipy

@sascha所述,您可能需要遵循scipy project建议的系统安装说明。