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

人盡茶涼 提交于 2019-12-24 10:18:29

问题


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.

回答1:


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.




回答2:


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"


来源:https://stackoverflow.com/questions/53975449/why-do-i-get-this-import-error-when-i-have-the-required-dlls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!