[英]ImportError: DLL load failed: The specified module could not be found for numpy
I have Python 3.3.2, 64 bit.我有 Python 3.3.2,64 位。 When I run a script with
import numpy
I get the following Error: ImportError: DLL load failed: The specified module could not be found.
当我使用
import numpy
运行脚本时,出现以下错误: ImportError: DLL load failed: The specified module could not be found.
. . The traceback is:
回溯是:
Traceback (most recent call last):
File "C:\Users\ZKZJFIO\workspace\FX_FORWARD_FLAG_DETERMINATION\Main.py", line 1, in <module>
import numpy
File "C:\Python33\numpy\__init__.py", line 180, in <module>
from . import add_newdocs
File "C:\Python33\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python33\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python33\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python33\numpy\core\__init__.py", line 14, in <module>
from . import multiarray
I looked at this link which appeared to be dealing with a similar issue and found that I do actually have multiarray.pyd so I am a bit confused as to how to resolve this issue as most questions about this error appear to be specific to that module.我查看了这个似乎正在处理类似问题的链接,发现我确实有 multiarray.pyd 所以我对如何解决这个问题有点困惑,因为关于这个错误的大多数问题似乎都是针对该模块的.
After running dependency walker on multiarray.pyd it appears MSVCR90.DLL and PYTHON27.DLL are missing.在 multiarray.pyd 上运行依赖项walker 后,似乎缺少 MSVCR90.DLL 和 PYTHON27.DLL。 Would it be worth just downloading Python27 to rectify this issue as I was told downloading dll's directly may not be the best thing?
是否值得只下载 Python27 来纠正这个问题,因为我被告知直接下载 dll 可能不是最好的事情?
Thank You谢谢你
Since the creator of Numpy co-founded a company that puts out a python distribution etc... (with Numpy as one of 195 libraries which work on windows) I would suggest you pick that one to use https://www.anaconda.com/distribution/#download-section .由于 Numpy 的创建者共同创立了一家推出 Python 发行版等的公司......(Numpy 作为 195 个在 Windows 上运行的库之一)我建议你选择那个使用https://www.anaconda。 com/distribution/#download-section 。 you can pick version 2.7 or 3.x
您可以选择版本 2.7 或 3.x
I recently experienced the same error when distributing a pyqt desktop application using pynsist/nsis to a group of users.我最近在使用 pynsist/nsis 向一组用户分发 pyqt 桌面应用程序时遇到了同样的错误。 And I thought I would just drop a comment that might help others.
我想我会留下一条可能对其他人有帮助的评论。
In this case the error traces back to the user having several versions of libiomp5md.dll on the computer.在这种情况下,错误可以追溯到用户在计算机上拥有多个版本的 libiomp5md.dll。 One of these files where located in an Intel Fortran compiler directory which was referenced in the system path variable.
这些文件之一位于系统路径变量中引用的英特尔 Fortran 编译器目录中。
The solution in my case was to force use of the correct libiomp5md.dll for the relevant python installation (in my case a virtual python 3.5 environment created using conda).在我的情况下,解决方案是强制使用正确的 libiomp5md.dll 进行相关的 python 安装(在我的情况下是使用 conda 创建的虚拟 python 3.5 环境)。 I did that by prepending system path with the directory library\\bin of the python installation.
我通过在系统路径前面加上 python 安装的目录 library\\bin 来做到这一点。
I had this problem as well after a fresh install of Miniconda and afterwards numpy via conda install numpy
in the Anaconda Prompt.在全新安装 Miniconda 之后我也遇到了这个问题,然后在 Anaconda Prompt 中通过
conda install numpy
。
What worked for me was uninstalling via对我有用的是通过卸载
conda uninstall numpy
and install with pip
instead:并使用
pip
安装:
pip install numpy
Note: It is not recommended, but also not discouraged, to install packages from pip into a conda environment.
注意:不建议但也不鼓励将 pip 中的软件包安装到 conda 环境中。
See here for more details: installing-non-conda-packages .
有关更多详细信息,请参见此处: installing-non-conda-packages 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.