gpt4 book ai didi

python - 导入 scipy.stats 时,获取 'ImportError: DLL load failed: The specified procedure could not be found'

转载 作者:行者123 更新时间:2023-12-03 20:28:30 25 4
gpt4 key购买 nike

我无法导入 scipy.stats 并收到以下错误,但不知何故

import scipy as sp

仍然可以正常工作。

其他库,如 numpy、pandas 可以毫无问题地导入。

我已经尝试在 Anaconda 中重新安装 scipy 1.2.1,降级到 scipy 1.2.0,但我仍然遇到找不到 ImportError 指定程序的问题。

我使用由 Anaconda 在 atom 文本编辑器中安装的 python 3.7.3 和 scipy 1.2.1。
---------------------------------------------------------------------------
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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com