Scipy install steps for ArcGIS v10.1

Discussion created by csny490 on Sep 5, 2013
Latest reply on Sep 5, 2013 by csny490
I would like to install the scipy site package (not the entire scipy "stack"), and am looking for someone's advice (a brief how-to) who has done this before and not totally whacked their ArcGIS Python 2.7 install. Idealy I want scipy to be available to both the ArcGIS 32 and 64 bit installs of Python (C:\Python27\ArcGIS10.1 and C:\Python27\ArcGISx6410.1 respectively).

I am assuming ArcGIS v10.1 SP1, Python 2.7.2, which is using numpy 1.6.1.

I have tried installing both scipy v0.12 and v0.10.1 from http://sourceforge.net/projects/scipy/files/scipy/, and while many of the scipy functions work, the 'stats' submodule (scipy.stats - aka the one I actually want to use!!!) does not.

When I was (1st) trying this with scipy v0.12 I got the error:

>>> from scipy import stats
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\stats\__init__.py", line 320, in <module>
    from .stats import *
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\stats\stats.py", line 241, in <module>
    import scipy.special as special
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
    from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.

Upon some advice here: http://forums.arcgis.com/threads/91254-ArcGIS-10.1-Python-crash-on-quot-import-arcpy-quot-after-installing-scipy-stack.?p=323887&viewfull=1#post323887, I downgraded to scipy v0.10.1 and now get a more exciting error (relating to numpy datatypes, but at least it seems to be getting closer!)

>>> from scipy import stats
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\stats\__init__.py", line 322, in <module>
    from stats import *
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\stats\stats.py", line 198, in <module>
    import distributions
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\stats\distributions.py", line 14, in <module>
    from scipy import optimize
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\optimize\__init__.py", line 135, in <module>
    from nonlin import *
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\optimize\nonlin.py", line 118, in <module>
    import scipy.sparse.linalg
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\sparse\__init__.py", line 182, in <module>
    from csgraph import *
  File "C:\Python27\ArcGIS10.1\lib\site-packages\scipy\sparse\csgraph\__init__.py", line 148, in <module>
    from ._shortest_path import shortest_path, floyd_warshall, dijkstra,\
  File "numpy.pxd", line 155, in init scipy.sparse.csgraph._shortest_path (scipy\sparse\csgraph\_shortest_path.c:13971)
ValueError: numpy.dtype has the wrong size, try recompiling

Anyone have any advice? Jason S.? Luke P.? or ???