Installing numpy for Windows 10: Importing the multiarray numpy extension module failed Installing numpy for Windows 10: Importing the multiarray numpy extension module failed numpy numpy

Installing numpy for Windows 10: Importing the multiarray numpy extension module failed


In my case this issue was related to numpy. So, I removed the numpy and again installed it. To remove numpy if you already have conda environment can we done by conda remove numpy if this command is removing some other packages also which are dependent on numpy then in the same environment if pip is installed, numpy can be removed using pip pip uninstall numpy and to again download it use pip install numpy. This should probably fix your error.


This issue was discussed extensively over on https://github.com/numpy/numpy/issues/9272 with a workaround solution which worked for me. It's pertinent to the Anaconda environment I believe you have.

Quoting:tobigithub commented on Jul 23, 2017.@njsmiththank you, I just confirmed using a VM on a clean Windows 10 system that has never seen Intel MKL DLLs, numpy or conda, all things are fine and numpy works. I am just puzzled how numpy suddenly stopped working, could be third parties. Probably needs some more digging, lets see what we can find out to make numpy ironclad to any dependency issue.

The solution is indeed related to some DLL depencency issues under WIN with Intel MKL librariesthe numpy import error was under python 3.6.2 and numpy 1.13.1 :

"import numpy"numpy\core_init_.py", line 16, infrom . import multiarrayImportError: DLL load failed: The specified procedure could not be found.

The quick and dirty solution is to copy all Intel mkl*.dll libraries from the specific environments (env) subfolder (seen at stackoverflow)

<\Library\bin> to<\Lib\site-packages\numpy\core>

04/13/2017  12:50 AM        30,277,392 mkl_avx.dll04/13/2017  12:50 AM        38,253,840 mkl_avx2.dll04/13/2017  12:50 AM        42,234,640 mkl_avx512.dll04/13/2017  12:50 AM        45,722,896 mkl_avx512_mic.dll04/13/2017  12:50 AM        25,369,360 mkl_core.dll04/13/2017  12:50 AM        24,541,456 mkl_def.dll04/13/2017  12:50 AM        24,506,640 mkl_intel_thread.dll04/13/2017  12:50 AM        29,744,400 mkl_mc.dll04/13/2017  12:50 AM        30,594,320 mkl_mc3.dll04/13/2017  12:50 AM        12,567,824 mkl_rt.dll04/13/2017  12:50 AM        11,388,688 mkl_sequential.dll04/13/2017  12:50 AM        12,575,504 mkl_tbb_thread.dll04/13/2017  12:50 AM        11,250,960 mkl_vml_avx.dll04/13/2017  12:50 AM        11,463,952 mkl_vml_avx2.dll04/13/2017  12:50 AM        10,285,840 mkl_vml_avx512.dll04/13/2017  12:50 AM        11,692,304 mkl_vml_avx512_mic.dll04/13/2017  12:50 AM         5,224,208 mkl_vml_cmpt.dll04/13/2017  12:50 AM         5,345,552 mkl_vml_def.dll04/13/2017  12:50 AM         9,477,904 mkl_vml_mc.dll04/13/2017  12:50 AM         9,368,336 mkl_vml_mc2.dll04/13/2017  12:50 AM         9,593,616 mkl_vml_mc3.dll

now numpy can be imported and runs fine.


I seem to have gotten numpy installed for Python 2.7.13 on the Windows 10 64-bit computer using the following steps. I was able to install numpy for either a 32-bit or a 64-bit version of Python 2.7.13. Instructions for both are provided.

At the top of this answer are my instructions for 32-bit Python.
In the middle are my instructions for 64-bit Python.At the bottom are my instructions for 64-bit Python using a wheel file.

I suspect the primary problem in my original post may have arisen from not realizing that apparently the default version of Python that is downloaded from here (https://www.python.org/downloads/) is 32-bit.

For installing numpy on 32-bit Python 2.7.13

  1. uninstalled Anaconda

  2. removed Anaconda from User Variables in the Environment Variables window

  3. installed Python 2.7.13 from the official Python website: https://www.python.org/

  4. in command window typed:

    C:\users\general1>cd:\python27

  5. Attempted to update pip in command window although pip was already up to date:

    python -m pip install -U pip

  6. in command window used the following command, which returned a huge number of errors:

    pip install numpy

  7. in command window typed:

    python -m pip install numpy

Step 7 seems to have worked. It returned the following message:

C:\Python27>python -m pip install numpyCollecting numpy  Retrying (Retry(total=4, connect=None, read=None, redirect=None))   after connection broken by 'ProtocolError('Connection aborted.',  error(10054, 'An existing connection was forcibly   closed by the remote host'))': /simple/numpy/  Downloading numpy-1.12.0-cp27-none-win32.whl (6.6MB)    100% |################################| 6.6MB 64kB/sInstalling collected packages: numpySuccessfully installed numpy-1.12.0
  1. Opened Python 2.7.13 and typed:

    import numpy

Only the command prompt was returned. No errors or warnings were issued.

I have not yet tried to use any code that requires numpy, but at least it seems to have been installed.

Step 7 says that a 32-bit file was downloaded:

numpy-1.12.0-cp27-none-win32.whl

I do not know whether a 32-bit version of numpy was installed or a 64-bit version. Perhaps the file is a 64-bit version that was renamed to say it was a 32-bit version as described in my question.

I typed in Python (from Do I have Numpy 32 bit or 64 bit?):

import numpy.distutils.system_info as sysinfosysinfo.platform_bits32

So, it seems a 32-bit version of numpy was installed although my Python is supposed to be a 64-bit version (from here: How do I determine if my python shell is executing in 32bit or 64bit mode on OS X?):

import platformplatform.architecture()[0]'32bit'

Perhaps in all of the installing and uninstalling of Python I accidentally installed a 32-bit version the last time. I can try installing Python again and use the intended 64-bit version this time. Hopefully the same steps above will still work.

Perhaps if I want a 64-bit version of Python 2.7.13 I am to click on the following on the official Python webpage (here: https://www.python.org/downloads/windows/):

Download Windows x86-64 MSI installer

instead of on the prominent (https://www.python.org/downloads/):

Download Python 2.7.13

I am also curious to know from where the file numpy-1.12.0-cp27-none-win32.whl was downloaded. I will provide that too if I find out. Maybe it was downloaded from here: https://pypi.python.org/pypi/numpy

For installing numpy on 64-bit Python 2.7.13

The steps above worked for installing numpy for what turned out to be a 32-bit version of Python 2.7.13.

To install numpy for a 64-bit version of Python 2.7.13 I used the following steps:

  1. uninstall Python 2.7.13

  2. Download: python-2.7.13.amd64.msi by clicking on: Download Windows x86-64 MSI installer from here: https://www.python.org/downloads/windows/

  3. in command window typed:

    C:\users\general1>cd:\python27

  4. Attempted to update pip in command window although pip was already up to date:

    python -m pip install -U pip

  5. in command window used the following command, which this time did not return any errors:

    pip install numpy

which returned:

C:\Python27>pip install numpyCollecting numpy  Downloading numpy-1.12.0-cp27-none-win_amd64.whl (7.5MB)    100% |################################| 7.5MB 63kB/sInstalling collected packages: numpySuccessfully installed numpy-1.12.0
  1. Opened Python 2.7.13 and typed:

    import numpy

No errors or warnings were returned.

  1. Checked whether numpy was 64-bit or 32-bit. It was 64-bit.

    import numpy.distutils.system_info as sysinfo

    sysinfo.platform_bits

    64

For installing numpy wheel files in Python 2.7.13

After installing numpy I tried to install scipy and received an error: numpy.distutils.system_info.NotFoundError: no lapack/blas resources found (described here Windows Scipy Install: No Lapack/Blas Resources Found).

I did the following:

  1. Uninstalled Python 2.7.13

  2. Installed Visual Studio Community 2017 RC as described by drewid (here: Windows Scipy Install: No Lapack/Blas Resources Found)

  3. Installed VCForPython27.msi also as described by drewid.

Then I received a scipy error cannot import name NUMPY_MKL mentioned here (ImportError: cannot import name NUMPY_MKL).

I downloaded the files numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl and scipy-0.18.1-cp27-cp27m-win_amd64.whl from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy as suggested by VMAtm.

Then I:

  1. uninstall Python 2.7.13

  2. Reinstall Python 2.7.13 using python-2.7.13.amd64.msi

  3. Installed numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy using the following line in the command window:

    pip install numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl

  4. Installed scipy-0.18.1-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy using the following line in the command window

    pip install scipy-0.18.1-cp27-cp27m-win_amd64.whl

Both numpy and scipy can now import inside Python 2.7.13

Note that I placed scipy-0.18.1-cp27-cp27m-win_amd64.whl and numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl in the folder c:\Python27 prior to using the aforementioned pip commands.

C:\>cd\Python27C:\Python27>pip install numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whlProcessing c:\python27\numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whlInstalling collected packages: numpySuccessfully installed numpy-1.12.0+mklC:\Python27>pip install scipy-0.18.1-cp27-cp27m-win_amd64.whlProcessing c:\python27\scipy-0.18.1-cp27-cp27m-win_amd64.whlInstalling collected packages: scipySuccessfully installed scipy-0.18.1C:\Python27>