from sklearn.feature_extraction.text import CountVectorizer
收到此错误
from sklearn.feature_extraction.text import CountVectorizer
File "C:UsersAnaconda3libsite-packagessklearn__init__.py", line 57, in <module>
from .base import clone
File "C:UsersAnaconda3libsite-packagessklearnbase.py", line 12, in <module>
from .utils.fixes import signature
File "C:UsersAnaconda3libsite-packagessklearnutils__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "C:UsersAnaconda3libsite-packagessklearnutilsvalidation.py", line 18, in <module>
from ..utils.fixes import signature
File "C:Users\Anaconda3libsite-packagessklearnutilsfixes.py", line 291, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr
from .eigen import *
File "C:UsersAnaconda3libsite-packagesscipysparselinalgeigen__init__.py", line 11, in <module>
from .arpack import *
File "C:UsersAnaconda3libsite-packagesscipysparselinalgeigenarpack__init__.py", line 22, in <module>
from .arpack import *
File "C:UsersAnaconda3libsite-packagesscipysparselinalgeigenarpackarpack.py", line 45, in <module>
from . import _arpack
ImportError: DLL load failed: The specified module could not be found.
根据这个github问题 https://github.com/hmmlearn/hmmlearn/issues/87
"解决方案是安装 mkl。"
conda install mkl
在这种情况下,一般建议是谷歌堆栈跟踪的最后两行,通常您会找到一个 github 或类似的线程。
就我而言(这是orange3
使用的依赖项之一),我必须遵循 https://github.com/hmmlearn/hmmlearn/issues/87 中的其他建议之一,即安装numpy+mkl
:
pip install "numpy-1.15.4+mkl-cp37-cp37m-win_amd64.whl"
我遇到了此错误,但mkl
已经安装,卸载numpy
和scipy
并将conda-forge
添加到我的环境通道中解决了这个问题:
conda remove --force numpy scipy
conda config --env --add channels conda-forge
conda install numpy