从 sklearn.utils 导入随机播放 - DLL 加载失败:找不到指定的过程



我无法从sklearn加载模块。错误消息显示"DLL 加载失败:找不到指定的过程。

蟒蛇版本:蟒蛇== 3.7.5

病态学习版本:scikit-learn == 0.21.3

我所做的只是运行以下一行代码。

from sklearn.utils import shuffle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearn__init__.py", line 76, in <module>
from .base import clone
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnbase.py", line 16, in <module>
from .utils import _IS_32BIT
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutils__init__.py", line 20, in <module>
from .validation import (as_float_array,
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutilsvalidation.py", line 21, in <module>
from .fixes import _object_dtype_isnan
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutilsfixes.py", line 18, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalg__init__.py", line 116, in <module>
from .eigen import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigen__init__.py", line 11, in <module>
from .arpack import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigenarpack__init__.py", line 22, in <module>
from .arpack import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigenarpackarpack.py", line 45, in <module>
from . import _arpack
ImportError: DLL load failed: The specified procedure could not be found.

我还尝试导入 sklearn 包。它也不起作用。

import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearn__init__.py", line 76, in <module>
from .base import clone
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnbase.py", line 16, in <module>
from .utils import _IS_32BIT
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutils__init__.py", line 20, in <module>
from .validation import (as_float_array,
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutilsvalidation.py", line 21, in <module>
from .fixes import _object_dtype_isnan
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagessklearnutilsfixes.py", line 18, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalg__init__.py", line 116, in <module>
from .eigen import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigen__init__.py", line 11, in <module>
from .arpack import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigenarpack__init__.py", line 22, in <module>
from .arpack import *
File "C:UsersuserMeAnaconda3envsenvironment001libsite-packagesscipysparselinalgeigenarpackarpack.py", line 45, in <module>
from . import _arpack
ImportError: DLL load failed: The specified procedure could not be found.

好吧,我切换到python == 3.5.6,sklearn == 0.20.0和scipy == 1.1.0,然后一切正常。我不确定为什么 sklearn 不适用于 python == 3.6 和 3.7,但它不应该发生。

相关内容

  • 没有找到相关文章

最新更新