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.
Asked By: user9683713

||

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.

Answered By: Tomasz Swider

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"
Answered By: prusswan

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
Answered By: bt3
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.