ImportError: DLL load failed: The specified module

2019-04-16 02:11发布

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.

4条回答
Viruses.
2楼-- · 2019-04-16 02:54

Uninstall and reinstall numpy and scipy, this fixed the problem for me.

查看更多
姐就是有狂的资本
3楼-- · 2019-04-16 03:00

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

查看更多
\"骚年 ilove
4楼-- · 2019-04-16 03:02

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.

查看更多
forever°为你锁心
5楼-- · 2019-04-16 03:13

Try Anaconda, it will solve your problem.

查看更多
登录 后发表回答