Installing numpy for Windows 10: Failed to import numarray numpy extension module

I am new to Pythonand unsuccessfully numpyinstall numpy. Currently, the problem is reading the error message in particular Importing the multiarray numpy extension module failed. I can not find this error message on the Internet and ask for help. The full error message is at the bottom of this post.

At first I thought that I should provide information about the system and version and describe what I did. I use Windows 10on a 64 bit machine and installed Python 2.7.13from https://www.python.org/downloads/windows/

I also installed Anaconda, also for the Python 2.764-bit machine, downloaded here https://www.continuum.io/downloads . Anacondalaunches Python 2.7.12, not Python 2.7.13. When I type import numpyinside the AnacondaGUI IPythonno errors or warnings appear. However, I got the impression that running numpyfrom Python 2.7.13using IDLE (Python GUI)might be computationally faster. Python 2.7.13appears first in my Path statement.

I downloaded numpy-1.12.0rc2+mkl-cp27-cp27m-win_amd64.whlfrom http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype. The following suggestions from this post install numpy from wheel format on windows (wheel is not supported on this platform.) I renamed:

numpy-1.12.0rc2+mkl-cp27-cp27m-win_amd64.whl for: numpy-1.12.0rc2+mkl-cp27-none-win32.whl

, . C:\Python27

Windows (cmd), pip :

python -m pip install --upgrade pip

, pip .

cmd:

pip install numpy-1.12.0rc2+mkl-cp27-none-win32.whl

: Successfully installed numpy-1.12.0rc2+mkl. ( .whl , , .)

numpy Python 2.7.13 Python :

import numpy

, :

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import numpy
  File "C:\Python27\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try 'git clean -xdf' (removes all
files not under version control).  Otherwise reinstall numpy.

C:\Python27 numpy .

:

>>> pip show numpy
SyntaxError: invalid syntax
>>> git clean -xdf
SyntaxError: invalid syntax
>>> 

, , , . Python 24 , numpy Python 2.7.13. R C - Python. , , numpy. . , , . , .

+11
4

NumPy. , NumPy . numpy, conda, conda remove numpy , numpy, , pip, numpy pip pip uninstall numpy , pip install numpy. , , .

+4

https://github.com/numpy/numpy/issues/9272 , . , , .

: tobigithub 23 2017 . @Njsmith , Windows 10, DLL- Intel MKL, numpy conda, . , NumPy, . , , , , .

DLL WIN Intel MKL, numpy python 3.6.2 numpy 1.13.1:

"import numpy" numpy\core_init_.py ", 16, from. import multiarray ImportError: DLL: .

- Intel mkl *.dll (env) ( stackoverflow).

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

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

NumPy .

+3

, numpy Python 2.7.13 64- Windows 10, . numpy 32- 64- Python 2.7.13. .

32- Python.
- 64- Python. 64- Python .

, , , - , , , -, Python, (https://www.python.org/downloads/) - 32-.

numpy 32- Python 2.7.13

  • uninstalled Anaconda

  • Anaconda User Variables Environment Variables

  • Python 2.7.13 Python: https://www.python.org/

  • :

    C:\\ 1 > CD:\python27

  • pip , pip :

    python -m pip install -U pip

  • , :

    pip install numpy

  • :

    python -m pip install numpy

7, , . :

C:\Python27>python -m pip install numpy
Collecting 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/s
Installing collected packages: numpy
Successfully installed numpy-1.12.0
  1. Python 2.7.13 :

    import numpy

. .

, numpy, , , , , .

7 , 32- :

numpy-1.12.0-cp27-none-win32.whl

, ​​32- numpy 64- . , 64- , , , 32- , .

Python ( Numpy 32- 64-?):

import numpy.distutils.system_info as sysinfo
sysinfo.platform_bits
32

, , ​​32- numpy, Python 64- (: python 32- 64- OS X?:

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

, Python 32- . Python 64- . , , , - .

, 64- Python 2.7.13, - Python (: https://www.python.org/downloads/windows/):

Download Windows x86-64 MSI installer

(https://www.python.org/downloads/):

Download Python 2.7.13

, numpy-1.12.0-cp27-none-win32.whl. , . , : https://pypi.python.org/pypi/numpy

numpy 64- Python 2.7.13

numpy , 32- Python 2.7.13.

numpy 64- Python 2.7.13, :

:

C:\Python27>pip install numpy
Collecting numpy
  Downloading numpy-1.12.0-cp27-none-win_amd64.whl (7.5MB)
    100% |################################| 7.5MB 63kB/s
Installing collected packages: numpy
Successfully installed numpy-1.12.0
  1. Python 2.7.13 :

    import numpy

.

  1. , numpy 64- 32-. 64-.

    numpy.distutils.system_info sysinfo

    sysinfo.platform_bits

    64

numpy Python 2.7.13

numpy scipy : numpy.distutils.system_info.NotFoundError: no lapack/blas resources found ( Windows Scipy Install: Lapack/Blas).

:

scipy cannot import name NUMPY_MKL (ImportError: NUMPY_MKL).

numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl scipy-0.18.1-cp27-cp27m-win_amd64.whl : http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy, VMAtm.

I:

numpy scipy Python 2.7.13

, scipy-0.18.1-cp27-cp27m-win_amd64.whl numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl c:\Python27 pip.

C:\>cd\Python27

C:\Python27>pip install numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl
Processing c:\python27\numpy-1.12.0+mkl-cp27-cp27m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.12.0+mkl

C:\Python27>pip install scipy-0.18.1-cp27-cp27m-win_amd64.whl
Processing c:\python27\scipy-0.18.1-cp27-cp27m-win_amd64.whl
Installing collected packages: scipy
Successfully installed scipy-0.18.1

C:\Python27>
+2
source

I fixed this problem with the following steps:

  1. Create and activate a new environment conda
  2. Installation numpyin the environment
  3. Then using this environment for my project

I used PyCharmto execute (3), I just set the project interpreter equal to the Python interpreter in the new environment that I created in (1).

0
source

Source: https://habr.com/ru/post/1014108/


All Articles