Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PYTHON DLL load failed

Tags:

python

dll

scipy

I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. However having downloaded the package it is proving difficult to run. I'm getting the following error:

Traceback (most recent call last):
  File "C:\launch.py", line 29, in <module>
    from src.smcsquare import SMCsquare
  File "C:\src\smcsquare.py", line 32, in <module>
    from scipy.stats import norm
  File "C:\Python34\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
    from .stats import *
  File "C:\Python34\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
    import scipy.special as special
  File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
    from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.

The _ufuncs.pyd is there in the C:\Python34\lib\site-packages\scipy\special\ directory. I tried adding this to my PYTHONPATH but it made no difference. I have also tried so dll fixers but these have not helped. Has anyone encountered this and did you find a solution?

like image 305
William Nolan Avatar asked Jul 23 '15 19:07

William Nolan


1 Answers

As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using.

Next, the problem I was having was I forgot to download and install the extra "numpy+mkl" package per the instruction: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

So for me it was numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl, which I downloaded and then:

python -m pip install numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl

I had already installed the regular numpy package via pip, but I just installed this one over it and everything started working and has been fine so far.

like image 53
Jesse Adamson Avatar answered Oct 21 '22 21:10

Jesse Adamson