【发布时间】:2017-05-11 04:54:47
【问题描述】:
我正在尝试代码from sklearn.datasets import load_iris。为此,我在我的 python 2.7.6 中安装了 sklearn 模块,但它显示了很长的错误
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from sklearn.datasets import load_iris
File "C:\Python27\lib\site-packages\sklearn\datasets\__init__.py", line 23, in <module>
from .twenty_newsgroups import fetch_20newsgroups
File "C:\Python27\lib\site-packages\sklearn\datasets\twenty_newsgroups.py", line 53, in <module>
from ..feature_extraction.text import CountVectorizer
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\__init__.py", line 10, in <module>
from . import text
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\text.py", line 24, in <module>
from ..preprocessing import normalize
File "C:\Python27\lib\site-packages\sklearn\preprocessing\__init__.py", line 6, in <module>
from ._function_transformer import FunctionTransformer
File "C:\Python27\lib\site-packages\sklearn\preprocessing\_function_transformer.py", line 2, in <module>
from ..utils import check_array
ImportError: cannot import name check_array
我想知道安装 sklearn 模块是否足够或者我错过了什么?请帮忙。我也在开发 Win 8.1
【问题讨论】:
-
你安装了所需的numpy和scipy了吗?
-
是的 numpy、scipy、matplotlib 已安装。
-
如果你在 Windows 上,你可以使用来自 lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn 的包(也许也重新安装 numpy)
-
您使用的是什么版本的 sklearn?检查这个:stackoverflow.com/questions/29596237/…
-
我正在使用 sklearn 0.13.1
标签: python machine-learning scipy scikit-learn