sklearn:在jupyter笔记本中导入sklean时出错

时间:2018-05-06 07:13:29

标签: python scikit-learn anaconda

导入sklearn会在anaconda jupyter笔记本中出错。我已经安装了scikitlearn包,问题仍然存在。

    Traceback (most recent call last):
  File "version.py", line 18, in <module>
    import sklearn
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\__init__.py", line 13
4, in <module>
    from .base import clone
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\base.py", line 13, in
 <module>
    from .utils.fixes import signature
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", l
ine 11, in <module>
    from .validation import (as_float_array,
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py",
 line 18, in <module>
    from ..utils.fixes import signature
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line
 144, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.
py", line 118, in <module>
    from .matfuncs import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\matfuncs.
py", line 19, in <module>
    import scipy.special
  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\special\__init__.py", l
ine 640, in <module>
    from ._ufuncs import *
ImportError: DLL load failed: The specified procedure could not be found.

(base) C:\Windows\system32>

1 个答案:

答案 0 :(得分:0)

正如this link中提到的看起来相似。你可能没有c ++ windows编译器。您将需要安装Visual C ++ Redistributable,然后重新安装anaconda可能会解决此问题。

另一方面,anaconda通常会负责安装c ++编译器。你有没有创建virtualenv和pip安装。我建议你使用conda install进行安装。

DataTable