简体   繁体   English

PYTHON DLL加载失败

[英]PYTHON DLL load failed

I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. 我通常在Matlab中编码但是我发现了一个很好的PYTHON代码,我想用它。 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. _ufuncs.pyd位于C:\\Python34\\lib\\site-packages\\scipy\\special\\目录中。 I tried adding this to my PYTHONPATH but it made no difference. 我尝试将它添加到我的PYTHONPATH但它没有任何区别。 I have also tried so dll fixers but these have not helped. 我也尝试过这样的dll修复工具,但这些并没有帮助。 Has anyone encountered this and did you find a solution? 有没有人遇到这个,你找到了解决方案吗?

As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using. 正如其他人所说,请确保您的.whl文件与您正在使用的python发行版的版本和32/64位匹配。

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 接下来,我遇到的问题是我忘记按照说明下载并安装额外的“numpy + mkl”软件包: 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: 所以对我来说它是numpy-1.11.0 + mkl-cp35-cp35m-win_amd64.whl,我下载了然后:

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. 我已经通过pip安装了常规的numpy包,但是我刚刚安装了这个包,所有内容都开始工作,到目前为止一切都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM