作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法导入 scipy.stats 并收到以下错误,但不知何故
import scipy as sp
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-dcc8e03bb4b3> in <module>
----> 1 from scipy import stats
~\Anaconda3\lib\site-packages\scipy\stats\__init__.py in <module>
365 from __future__ import division, print_function, absolute_import
366
--> 367 from .stats import *
368 from .distributions import *
369 from .morestats import *
~\Anaconda3\lib\site-packages\scipy\stats\stats.py in <module>
171 from scipy._lib._util import _lazywhere
172 import scipy.special as special
--> 173 from . import distributions
174 from . import mstats_basic
175 from ._stats_mstats_common import _find_repeats, linregress, theilslopes, siegelslopes
~\Anaconda3\lib\site-packages\scipy\stats\distributions.py in <module>
8 from __future__ import division, print_function, absolute_import
9
---> 10 from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
11 rv_frozen)
12
~\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py in <module>
22
23 # for root finding for discrete distribution ppf, and max likelihood estimation
---> 24 from scipy import optimize
25
26 # for functions of continuous distributions (e.g. moments, entropy, cdf)
~\Anaconda3\lib\site-packages\scipy\optimize\__init__.py in <module>
385
386 from .optimize import *
--> 387 from ._minimize import *
388 from ._root import *
389 from ._root_scalar import *
~\Anaconda3\lib\site-packages\scipy\optimize\_minimize.py in <module>
28 from ._trustregion_krylov import _minimize_trust_krylov
29 from ._trustregion_exact import _minimize_trustregion_exact
---> 30 from ._trustregion_constr import _minimize_trustregion_constr
31
32 # constrained minimization
~\Anaconda3\lib\site-packages\scipy\optimize\_trustregion_constr\__init__.py in <module>
2
3
----> 4 from .minimize_trustregion_constr import _minimize_trustregion_constr
5
6 __all__ = ['_minimize_trustregion_constr']
~\Anaconda3\lib\site-packages\scipy\optimize\_trustregion_constr\minimize_trustregion_constr.py in <module>
2 import time
3 import numpy as np
----> 4 from scipy.sparse.linalg import LinearOperator
5 from .._differentiable_functions import VectorFunction
6 from .._constraints import (
~\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 *
~\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
~\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 *
~\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ใ
最佳答案
谷歌搜索一段时间后,我遇到了这个:
https://github.com/conda/conda/issues/6396
因为我很绝望,所以我尝试了。它奏效了!
我通过删除 Anaconda 安装的 scipy 和
使用python预先安装的pip来安装scipy。
它以某种方式解决了问题。
会把这个答案留给任何不幸的灵魂。
关于python - 导入 scipy.stats 时,获取 'ImportError: DLL load failed: The specified procedure could not be found',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55659982/
我是一名优秀的程序员,十分优秀!