user9683713
user9683713

Reputation: 185

Why do I get this import error when I have the required DLLs?

from sklearn.feature_extraction.text import CountVectorizer

getting this error

 from sklearn.feature_extraction.text import CountVectorizer

  File "C:\Users\Anaconda3\lib\site-packages\sklearn\__init__.py", line 57, in <module>
    from .base import clone

  File "C:\Users\Anaconda3\lib\site-packages\sklearn\base.py", line 12, in <module>
    from .utils.fixes import signature

  File "C:\Users\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,

  File "C:\Users\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature

  File "C:\Users\\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 291, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr


    from .eigen import *

  File "C:\Users\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py", line 11, in <module>
    from .arpack import *

  File "C:\Users\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py", line 22, in <module>
    from .arpack import *

  File "C:\Users\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 45, in <module>
    from . import _arpack

ImportError: DLL load failed: The specified module could not be found.

Upvotes: 2

Views: 8235

Answers (3)

bt3
bt3

Reputation: 188

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

Upvotes: 0

prusswan
prusswan

Reputation: 7091

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"

Upvotes: 2

Tomasz Swider
Tomasz Swider

Reputation: 2372

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.

Upvotes: 2

Related Questions