0

I installed Python and pip on my Windows 10 machine (it's a Lenovo Yoga 3).

pip install numpy generated errors, but I successfully installed it from a wheel.

Unofficial Windows Binaries for Python Extension Packages

This included a trick found at this question: Cannot install NumPy from a wheel format

Next I try using NumPy, and it doesn't find anything:

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\J\Downloads>pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in c:\python27\lib\site-packages

C:\Users\J\Downloads>py -2
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\numpy\__init__.py", line 200, 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 14, in <module>
    from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>

This may not be specific to Python, but I have not figured it out yet. For work purposes, I have a dual-boot partition: Windows 10 and Ubuntu 15.04 (Vivid Vervet).

ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
john mangual
  • 7,718
  • 13
  • 56
  • 95
  • are you sure you didn't install a 64-bit wheel? – Paul H Jan 15 '16 at 19:12
  • @PaulH I installed a 64-bit wheel and renamed it... How do I tell if I am running 32-bit or 64-bit windows? – john mangual Jan 15 '16 at 19:24
  • You're most likely on 64-bit windows, but that doesn't matter. What matters is that you're on 32-bit python, so all of your third party extensions need to be the 32-bit versions as well. – Paul H Jan 15 '16 at 19:26
  • @PaulH it's very early on -- I just got this computer two weeks ago. I would wipe out Python and try again https://www.python.org/downloads/release/python-2711/ – john mangual Jan 15 '16 at 19:32
  • if it were my machine, I'd wipe out whatever you've installed and just use conda http://conda.pydata.org/miniconda.html – Paul H Jan 15 '16 at 19:34
  • If you want a nice, modern, scientific and plug and play package, I suggest you http://www.pyzo.org/ . – B. M. Jan 15 '16 at 19:50

2 Answers2

1

Your Python interpreter is 32 bit and most probably you installed a 64 bit version of NumPy. If your Windows is 64 bit, I advise that you remove Python and install a 64 bit Python and install libraries needed again.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sharno
  • 630
  • 8
  • 14
0

I had a similar problem for Python 3.6, pip install numpy (on Windows 10).

I managed to finally solve it by installing from binary here:

Enter link description here

I found the previous link in this guide:

This guide...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
kishu
  • 73
  • 1
  • 9