我正在尝试代码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上工作
最佳答案
为什么最新版本为0.18时仍使用sklearn 0.13.1?您已经过时,可能有依赖性问题。
如果您希望生活更轻松,请安装anaconda。所有软件包版本均可协同工作,而无需编译任何内容。
关于python - Sklearn数据集,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41336094/