使用依赖于scipy的程序包会引发ImportError(DLL加载失败),即使重新安装Anaconda也是如此

时间:2019-05-07 12:41:47

标签: python python-3.x scikit-learn scipy anaconda

在我所有使用依赖scipy的软件包的脚本中(例如sklearn和statsmodels),我都会收到此ImportError。

我卸载了Anaconda并安装了新版本的Anaconda(Windows 10最新版本为2019.03)。我也尝试过创建单独的环境并独立安装scipy,numpy,sklearn,但这也行不通。

from sklearn import preprocessing
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d27a4e3c0526> in <module>
----> 1 from sklearn import preprocessing

~\AppData\Local\Continuum\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 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\base.py in <module>
     12 from scipy import sparse
     13 from .externals import six
---> 14 from .utils.fixes import signature
     15 from .utils import _IS_32BIT
     16 from . import __version__

~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\utils\__init__.py in <module>
     14 from . import _joblib
     15 from ..exceptions import DataConversionWarning
---> 16 from .fixes import _Sequence as Sequence
     17 from .deprecation import deprecated
     18 from .validation import (as_float_array,

~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\utils\fixes.py in <module>
     90     from ._scipy_sparse_lsqr_backport import lsqr as sparse_lsqr
     91 else:
---> 92     from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
     93 
     94 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py in <module>
    115 from .dsolve import *
    116 from .interface import *
--> 117 from .eigen import *
    118 from .matfuncs import *
    119 from ._onenormest import *

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py in <module>
      9 from __future__ import division, print_function, absolute_import
     10 
---> 11 from .arpack import *
     12 from .lobpcg import *
     13 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py in <module>
     20 from __future__ import division, print_function, absolute_import
     21 
---> 22 from .arpack import *

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py in <module>
     43 __all__ = ['eigs', 'eigsh', 'svds', 'ArpackError', 'ArpackNoConvergence']
     44 
---> 45 from . import _arpack
     46 import numpy as np
     47 import warnings

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

1 个答案:

答案 0 :(得分:0)

问题似乎与不兼容的scipy版本有关,您可以尝试通过以下方式重新安装它:

conda install -f scipy

希望有帮助!