4

I have a new machine with a fresh install of Arc10.1. When ArcGIS installs it also installs python 2.7 with numpy. My script can import scipy (import scipy), but when I try

from scipy import stats

I get:

Traceback (most recent call last):
File "C:\ArcProjects\BasinLoop3_All6.py", line 13, in <module>
from scipy import stats
File "C:\Python27\ArcGISx6410.1\lib\site-packages\scipy\stats\__init__.py", line 324, in <module>
from .stats import *
File "C:\Python27\ArcGISx6410.1\lib\site-packages\scipy\stats\stats.py", line 242, in <module>
import scipy.special as special
File "C:\Python27\ArcGISx6410.1\lib\site-packages\scipy\special\__init__.py", line 531, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.

I have tried several scipy installs and I get the same result with each:

scipy-0.13.0-win32-superpack-python2.7.exe

scipy-0.13.0.win-amd64-py2.7.exe

scipy-0.11.0-win32-superpack-python2.7.exe

I figure it has to do do with some incompatibility with the different numpy, scipy versions and the version of python that came with Arc10.1 (py2.7). Also you can see from my error that my script (ran in IDLE) that it is trying to run this with 64bit python. Can someone help me sort out what's going on here? I do not want to install a new version of python or numpy because I don't want to mess with the default ArcGIS installation. I'd also like for python to continue operating in 64bit if possible.

Thanks...

therMapper
  • 43
  • 2
  • 7
  • The scipy installer you use needs to be built with the same compiler that ESRI used to build the python execuctable that Arc ships with. I have no idea what they use, though. On a side note, ArcGIS has 64-bit builds now?? I didn't know that... – Joe Kington Oct 28 '13 at 03:19
  • 1
    @JoeKington: ArcGIS for Desktop and ArcGIS Engine are 32-bit only, but starting at 10.1 you can install [64-bit background geoprocessing](http://blogs.esri.com/esri/arcgis/2012/10/31/announcing-64-bit-geoprocessing/) to work with 32-bit ArcGIS. ArcGIS for Server is 64-bit only starting at 10.1. – Gary Sheppard Oct 28 '13 at 11:44

2 Answers2

2

Have a look at this:

Scipy install steps for ArcGIS v10.1

This user had success with scipy v0.11 only. You tried v0.11, but it was 32-bit, and you're using 64-bit Python. Try scipy v0.11 64-bit and see what happens.

Gary Sheppard
  • 4,764
  • 3
  • 25
  • 35
  • Thanks for the tip. I saw that post and it was the reason I was trying v0.11 in the first place. I couldn't find a 64 bit version of v0.11. I couldn't find it on Surgeforce or http://www.lfd.uci.edu/~gohlke/pythonlibs/ or elsewhere. Any tips on where it might exist? I was hoping the file would be named: scipy-0.11.0.win-amd64-py2.7.exe but no luck so far. – therMapper Oct 29 '13 at 00:32
  • Sorry, I can't find 64-bit v0.11 either. You might have to [build it from source](http://www.scipy.org/scipylib/building/windows.html) in 64-bit mode. To make it work with ArcGIS, you'll likely need to build with Visual C++ as opposed to one of the other options. However, maybe someone will surprise you with an answer to [your other question](http://stackoverflow.com/questions/19647964/legacy-versions-of-scipy-looking-for-v0-11-64bit). Good luck. – Gary Sheppard Oct 30 '13 at 13:08
0

Open C:\Python27\ArcGISx6410.1\lib\site-packages\scipy\special\_ufuncs.pyd with Dependency Walker and see which DLLs are missing.

Mehraban
  • 3,164
  • 4
  • 37
  • 60