I am new to Python and am attempting unsuccessfully to install numpy. The current problem is an error message reading, in part, Importing the multiarray numpy extension module failed. I cannot locate this error message on the internet and am asking for help. The complete error message is at the bottom of this post.
First I thought I should provide system and version details and describe what I have done. I am running Windows 10 on a 64-bit machine and have installed Python 2.7.13 from https://www.python.org/downloads/windows/
I have also installed Anaconda, also for Python 2.7 and a 64-bit machine, downloaded from here https://www.continuum.io/downloads. Anaconda runs Python 2.7.12, rather than Python 2.7.13. When I type import numpy inside the Anaconda GUI IPython no errors or warnings appear. Nevertheless, I have the impression running numpy from inside Python 2.7.13 using IDLE (Python GUI) might be computationally faster. Python 2.7.13 appears first in my Path statement.
I downloaded numpy-1.12.0rc2+mkl-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype Following suggestions from this post installing numpy from wheel format on windows ( not a supported wheel on this platform.) I renamed:
numpy-1.12.0rc2+mkl-cp27-cp27m-win_amd64.whl to:
numpy-1.12.0rc2+mkl-cp27-none-win32.whl
manually by clicking on the name and editing it. The renamed file is in the folder C:\Python27
Then I used the Windows command window (cmd) to update pip typing:
python -m pip install --upgrade pip
A message said pip was already up-to-date.
Then I typed the following in the cmd window:
pip install numpy-1.12.0rc2+mkl-cp27-none-win32.whl
A message said: Successfully installed numpy-1.12.0rc2+mkl. (Prior to doing this I attempted to install the .whl file using its original name and received an error that the file was not for my platform.)
After installing numpy in Python 2.7.13 I open Python and typed:
import numpy
Here is the complete error message that was returned:
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.
Numerous numpy folders and files now appear inside C:\Python27
I also tried the following two commands and received the messages shown:
>>> pip show numpy
SyntaxError: invalid syntax
>>> git clean -xdf
SyntaxError: invalid syntax
>>>
Sorry that this post is so long, but I do not know which of the above details might be most helpful in diagnosing the problem. I have only been using Python for about 24 hours and most of that time has been spent attempting to install numpy into Python 2.7.13. Mostly I use R and know some C. I have not attempted to install any other Python libraries or packages. Perhaps I am missing dependencies required by numpy. Thank you for any advice or assistance with this problem. If I can provide additional information please let me know. Sorry if this is a duplicate.