Jojo
Jojo

Reputation: 1117

ImportError: DLL load failed: The specified module could not be found for numpy

I have Python 3.3.2, 64 bit. When I run a script with import numpy I get the following Error: 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.

After running dependency walker on multiarray.pyd it appears MSVCR90.DLL and PYTHON27.DLL are missing. 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?

Thank You

Upvotes: 3

Views: 6503

Answers (3)

Tim Skov Jacobsen
Tim Skov Jacobsen

Reputation: 3852

I had this problem as well after a fresh install of Miniconda and afterwards numpy via conda install numpy in the Anaconda Prompt.

What worked for me was uninstalling via

conda uninstall numpy

and install with pip instead:

pip install numpy

Note: It is not recommended, but also not discouraged, to install packages from pip into a conda environment.

See here for more details: installing-non-conda-packages.

Upvotes: 1

Back2Basics
Back2Basics

Reputation: 7806

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 . you can pick version 2.7 or 3.x

Upvotes: 1

Per
Per

Reputation: 11

I recently experienced the same error when distributing a pyqt desktop application using pynsist/nsis to a group of users. 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. One of these files where located in an Intel Fortran compiler directory which was referenced in the system path variable.

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). I did that by prepending system path with the directory library\bin of the python installation.

Upvotes: 1

Related Questions