如何在Eclipse上正确安装sklearn

时间:2015-05-04 14:37:08

标签: python-2.7 scikit-learn

我最近遇到了一个关于如何安装sklearn的博客(http://stronginference.com/ScipySuperpack/)。我成功安装了它并存储在路径上: /usr/local/lib/python2.7/site-packages/sklearn

然后我去了日食的属性;在Interpreter-Python下并添加了PYTHONPATH的路径。我可以导入sklearn,但是当我运行这个简单的代码来测试所有内容时:

    Traceback (most recent call last):
  File "/Users/licheng/Documents/workspaceII/SkLearnTutorial/Src/my_first_scilearn.py", line 6, in <module>
    from sklearn import datasets
  File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/__init__.py", line 7, in <module>
    from .base import load_diabetes
  File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/base.py", line 24, in <module>
    from ..utils import check_random_state
  File "/usr/local/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module>
    from .murmurhash import murmurhash3_32
  File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (/private/var/folders/fv/vhs3w0zn2q961_gyp8f2z_rw0000gn/T/pip-EVsI8B-build/sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling

它引发了以下错误:

.forceDisplay { display: table-row-group !important; }

对可能出错的任何帮助?我已经在这几个小时了。

由于

1 个答案:

答案 0 :(得分:1)

尝试卸载NumPy,SciPy和scikit-learn。 然后重新安装这些包。

如果您使用的是Windows,那么这些软件包的二进制文件已经由Christoph Gohlke提供,这非常方便。只需下载它们,然后使用pip进行安装。

Unofficial Windows Binaries for Python Extension Packages