8

I'm installing numpy through pip on python 2.7.9... I checked pip list, and it returns pip (1.5.6), setuptools (12.0.4). I'm running on Windows 7 64-bit, and I've tried both Python 32 and 64-bit versions.

pip install numpy ends with:

Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\jon\\appdata\\local\\temp\\pip_build_jon\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\jon\appdata\local\temp\pip-qnynnf-record\install-record.txt --single-version-externally-managed 

--compile failed with error code 1 in c:\users\jon\appdata\local\temp\pip_build_jon\numpyStoring 

debug log for failure in C:\Users\jon\pip\pip.log

When I checked stackoverflow for other posts about errorcode 1, their solutions were to make sure you have an up-to-date version of setuptools. I installed Python 2.7.9 from the main website, and it comes with both setuptools and pip ready to go. Plus I made sure my system had them installed by checking pip list.

So instead I looked up the debug log the console error told me to go to, at C:\Users\jon\pip\pip.log. It's quite lengthy, but near the end it says

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

I went to that url, downloaded the compiler, and ran pip install numpy again. It didn't throw errorcode 1 this time, but had a different issue. It printed a huge wall of text to the screen, which never happened the last time I installed numpy/matplotlib/etc. It printed the text for a few minutes, then froze and stopped.

I'm not sure how to proceed?

If it helps I can post the pip debug log.

Jonathan Brouwer
  • 315
  • 2
  • 5
  • 12
  • there is meant to be a *huge wall of text* when it is compiling. What was the last thing it printed? – Padraic Cunningham Jan 25 '15 at 23:31
  • Installing numpy with pip will attempt to compile it. This can be painful on Windows, esepcially 64-bit. You are better off using an EXE installer from [this page](http://www.lfd.uci.edu/~gohlke/pythonlibs/). – BrenBarn Jan 25 '15 at 23:34
  • @PadraicCunningham It's pretty indecipherable. Here's a screenshot I took: [http://i.imgur.com/aAvYAJ4.png] – Jonathan Brouwer Jan 25 '15 at 23:47
  • try the gohlke prebuilt binary Brenbarn suggested and if you have no luck add any error output to your question – Padraic Cunningham Jan 25 '15 at 23:54
  • I'm also for the precompiled EXE installer. – ljk321 Jan 25 '15 at 23:55
  • Which wheel did you download? Did you put it in the right directory? In your screenshot it looks like you have two underscores in `win__amd64.whl`, but the file only has one(`win_amd64.whl`). – BrenBarn Jan 26 '15 at 00:11
  • @BrenBarn Yeah, I put in the wrong file name (deleted my comment asking about it, but you got it anyway). – Jonathan Brouwer Jan 26 '15 at 00:15

1 Answers1

32

Download the wheel (.whl file) file from here and install with pip:

  1. pip install wheel to install support for wheel files.
  2. pip install numpy‑1.9.1+mkl‑cp27‑none‑win32.whl to install the wheel.
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70