Why do I get this import error when I have the required DLLs?
Question:
from sklearn.feature_extraction.text import CountVectorizer
getting this error
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.
Answers:
According to this github issue https://github.com/hmmlearn/hmmlearn/issues/87
“The solution is to install mkl.”
conda install mkl
General advice in case like this is to google last two lines of the stack trace, usually you will find a github or similar thread about it.
In my case (this is one of the dependencies used by orange3
), I had to follow one of the other suggestions in https://github.com/hmmlearn/hmmlearn/issues/87, which is to install numpy+mkl
:
pip install "numpy-1.15.4+mkl-cp37-cp37m-win_amd64.whl"
I had this error but mkl
was already installed, uninstalling numpy
and scipy
and adding conda-forge
to my environment’s channels fixed the issue:
conda remove --force numpy scipy
conda config --env --add channels conda-forge
conda install numpy
from sklearn.feature_extraction.text import CountVectorizer
getting this error
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.
According to this github issue https://github.com/hmmlearn/hmmlearn/issues/87
“The solution is to install mkl.”
conda install mkl
General advice in case like this is to google last two lines of the stack trace, usually you will find a github or similar thread about it.
In my case (this is one of the dependencies used by orange3
), I had to follow one of the other suggestions in https://github.com/hmmlearn/hmmlearn/issues/87, which is to install numpy+mkl
:
pip install "numpy-1.15.4+mkl-cp37-cp37m-win_amd64.whl"
I had this error but mkl
was already installed, uninstalling numpy
and scipy
and adding conda-forge
to my environment’s channels fixed the issue:
conda remove --force numpy scipy
conda config --env --add channels conda-forge
conda install numpy