本文介绍了在 Windows 上使用 Scipy 的 AMD64 版本调用 scikit-learn 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这一行收到此错误:

I am getting this error on this line:

from sklearn.ensemble import RandomForestClassifier

错误日志是:

Traceback (most recent call last):
  File "C:\workspace\KaggleDigits\KaggleDigits.py", line 5, in <module>
    from sklearn.ensemble import RandomForestClassifier
  File "C:\Python27\lib\site-packages\sklearn\ensemble\__init__.py", line 7, in <module>
    from .forest import RandomForestClassifier
  File "C:\Python27\lib\site-packages\sklearn\ensemble\forest.py", line 47, in <module>
    from ..feature_selection.selector_mixin import SelectorMixin
  File "C:\Python27\lib\site-packages\sklearn\feature_selection\__init__.py", line 7, in <module>
    from .univariate_selection import chi2
  File "C:\Python27\lib\site-packages\sklearn\feature_selection\univariate_selection.py", line 13, in <module>
    from scipy import stats
  File "C:\Python27\lib\site-packages\scipy\stats\__init__.py", line 320, in <module>
    from .stats import *
  File "C:\Python27\lib\site-packages\scipy\stats\stats.py", line 241, in <module>
    import scipy.special as special
  File "C:\Python27\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
    from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.

安装后:

  • 适用于 Windows x86-64 的 Python 2.7.4
  • scipy-0.12.0.win-amd64-py2.7.‌exe(来自此处)
  • numpy-unoptimized-1.7.1.win-amd64-py2.7.‌exe(来自 这里)
  • scikit-learn-0.13.1.win-amd64-py2.7.‌exe(来自 这里)

有人知道为什么会发生这种情况以及如何解决吗?

Anybody know why this is happening and how to solve it ?

推荐答案

正如 Christoph Gohlke 在下载时提到的 页面,可从他的网站下载的 scikit-learn 需要 Numpy-MKL.因此我在使用 Numpy-Unoptimized 时犯了一个错误.

As Christoph Gohlke mentioned on his download page, the scikit-learn downloadable from his website requires Numpy-MKL. Therefore I made a mistake by using Numpy-Unoptimized.

指向他的 Numpy-MKL 的链接是静态链接到 Intel 的 MKL,因此您不需要任何额外的下载(无需下载 Intel 的 MKL).

The link to his Numpy-MKL is statically linked to the Intel's MKL and therefore you do not need any additional download (no need to download Intel's MKL).

这篇关于在 Windows 上使用 Scipy 的 AMD64 版本调用 scikit-learn 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 12:21