[GIS] Installing scipy.spatial with ArcPy gives DLL load failed error on import

arcpyinstallationscipy.spatial

I am running python 2.7.6 from an ArcGIS installation. I have tried to install scipy from the Python Exchange Packages here, using the scipy-0.14.0.win32-py2.7.exe executable. I get no error importing scipy, but when I try to import scipy.spatial I get the following error:

In [1]: import scipy

In [2]: import scipy.spatial
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-6f8fbf892cc9> in <module>()
----> 1 import scipy.spatial

C:\Python27\ArcGIS10.2\lib\site-packages\scipy\spatial\__init__.py in <module>()
     89 from .kdtree import *
     90 from .ckdtree import *
---> 91 from .qhull import *
     92 from ._plotutils import *
     93

ImportError: DLL load failed: %1 is not a valid Win32 application.

Anyone had success install scipy with spatial functions on top of Esri's Python site-package (ArcPy)?

Best Answer

The version of scipy that Christolph Gohlke has (very kindly) compiled is compiled against the version of numpy he's compiled with the against the Intel Math Kernel Library. This is different to the version of numpy that's released with ArcGIS, and as such won't work with the ArcGIS installed version.

Instead if you download scipy from the official SourceForge repository it should work.