ImportError: DLL load failed: The specified module could not be found (sklearn)

匿名 (未验证) 提交于 2019-12-03 00:44:02

问题:

I installed numpy, scipy and scikit-learn in Python 3.5. When I run my program, I get this error.

Traceback (most recent call last):   File "D:/Dropbox/Cong Toan/Tools/NLP_Tools/doc_sim.py", line 1, in <module>     from sklearn.feature_extraction.text import TfidfVectorizer   File "C:\Python35-32\lib\site-packages\sklearn\__init__.py", line 57, in <module>     from .base import clone   File "C:\Python35-32\lib\site-packages\sklearn\base.py", line 11, in <module>     from .utils.fixes import signature   File "C:\Python35-32\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>     from .validation import (as_float_array,   File "C:\Python35-32\lib\site-packages\sklearn\utils\validation.py", line 16, in <module>     from ..utils.fixes import signature   File "C:\Python35-32\lib\site-packages\sklearn\utils\fixes.py", line 324, in <module>     from scipy.sparse.linalg import lsqr as sparse_lsqr   File "C:\Python35-32\lib\site-packages\scipy\sparse\linalg\__init__.py", line 112, in <module>     from .isolve import *   File "C:\Python35-32\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>     from .iterative import *   File "C:\Python35-32\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>     from . import _iterative ImportError: DLL load failed: The specified module could not be found. 

回答1:

It actually requires numpy+mkl. But it's difficult to say if that is the problem with your distribution.

My advice is that you use one of the available distributions that already bring those libraries. I recommend WinPython, but I also heard good things about Anaconda.

It's easy to install other packages with WinPython using:

Unofficial Windows Binaries for Python Extension Packages

By Christoph Gohlke.

If you really want to solve that issue with your current distribution you'll have to provide more information such as versions that you installed, previous modules installed, and how you installed them.



回答2:

I have the same problem too, after days of searching and reinstalling almost every thing. I found out the answer:

Step 1: Uninstall scipy and numpy

Step 2: Dowload numpy+mkl( the package name is numpy+mkl, not numpy package and mkl package) and scipy from this page as armatita mentioned

Step3: Install numpy+mkl first and scipy after that

Good luck to you



回答3:

Try Anaconda, it will solve your problem.



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