python - 使用 Anaconda 在 Jupyter 笔记本中进行 Scikit Learn

标签 python scikit-learn jupyter

这不是重复的,因为链接的问题没有解决如何找到所需的 dll 或修复安装。

当我尝试导入 sklearn v.0.20 时,我得到以下信息。我正在使用 anaconda,numpy 和 scipy 都是最新的。

ImportError                               Traceback (most recent call last)
<ipython-input-1-8fd979e02004> in <module>()
----> 1 import sklearn

C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\sklearn\__init__.py in <module>()
     62 else:
     63     from . import __check_build
---> 64     from .base import clone
     65     from .utils._show_versions import show_versions
     66 

C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\sklearn\base.py in <module>()
     11 from scipy import sparse
     12 from .externals import six
---> 13 from .utils.fixes import signature
     14 from . import __version__
     15 

C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\sklearn\utils\__init__.py in <module>()
     11 
     12 from .murmurhash import murmurhash3_32
---> 13 from .validation import (as_float_array,
     14                          assert_all_finite,
     15                          check_random_state, column_or_1d, check_array,

C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\sklearn\utils\validation.py in <module>()
     20 
     21 from ..externals import six
---> 22 from ..utils.fixes import signature
     23 from .. import get_config as _get_config
     24 from ..exceptions import NonBLASDotWarning

C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\sklearn\utils\fixes.py in <module>()
     81             return stats.boxcox(x, lmbda)
     82 else:
---> 83     from scipy.special import boxcox  # noqa
     84 
     85 

    C:\Users\James2SxyBoogaloo\Anaconda3\lib\site-packages\scipy\special\__init__.py in <module>()
    638 from .sf_error import SpecialFunctionWarning, SpecialFunctionError
    639 
--> 640 from ._ufuncs import *
    641 
    642 from .basic import *

ImportError: DLL load failed: The specified module could not be found.

最佳答案

编辑:

我找到了这个帖子:https://github.com/numpy/numpy/issues/10965

这提到了一个与此相关的问题。

看来那里的人通过删除 numpy 和 scipy 并重新安装它们解决了他的问题。您的 scipy 版本可能由于某种原因与 MLK 版本的 numpy 链接,这就是事情不起作用的原因。

编辑结束

<小时/>

我查了一下你的问题,看来这与你的 numpy 版本有关。

要解决此问题,您应该安装 numpy-MLK,它是与英特尔数学内核库链接的 numpy 版本。

您可以在这里找到它: https://pypi.org/project/numpy-mkl/

请记住首先删除已经存在的 numpy 包。

您可以在此处找到更多信息:

ImportError when importing certain modules from SciPY

这里:

Difference between Numpy and Numpy-MKL?

关于python - 使用 Anaconda 在 Jupyter 笔记本中进行 Scikit Learn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52928348/

相关文章:

python-2.7 - DICT() 和 MATPLOTLIB?

python - 如何使用 scikit-learn 对约束进行交叉验证

python - 将 Anaconda 添加到 PATH 后,Jupyter Notebook 无法打开?

python - 如何将 ipywidget slider 的默认位置更改为 matplotlib 图的一侧?

python - 根据重叠目标将多个索引折叠成组

python - 如何使用opencv对齐多个相机图像

Python,从生成器中生成的紧凑方法

python - Anaconda 导入错误 :/usr/lib64/libstdc++. so.6:未找到版本 `GLIBCXX_3.4.21'

python - sklearn 分类指标 auc 返回 ValueError

scala - 如何在 sbt 项目中重用 Ammonite REPL 的 sc 文件?