I just installed Anaconda 1.9.1 on a 64-bit Linux system running Scientific Linux release 6.5 (Carbon). I used all of the defaults. I successfully installed GDAL using conda. As has been reported by other users, I'm getting the "ImportError: No module named _gdal_array" issue:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/home/nobody/anaconda/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
202 else:
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/blah/plot_nitf.py in <module>()
27
28 # 3.
---> 29 arr = geo.ReadAsArray()
30 #plt.imshow(arr[:3,:,:].transpose((1, 2, 0)))
31 #plt.show()
/home/nobody/anaconda/lib/python2.7/site-packages/osgeo/gdal.pyc in ReadAsArray(self, xoff, yoff, xsize, ysize, buf_obj)
779
780 def ReadAsArray(self, xoff=0, yoff=0, xsize=None, ysize=None, buf_obj=None ):
--> 781 import gdalnumeric
782 return gdalnumeric.DatasetReadAsArray( self, xoff, yoff, xsize, ysize, buf_obj )
783 def WriteRaster(self, xoff, yoff, xsize, ysize,
/home/nobody/anaconda/lib/python2.7/site-packages/osgeo/gdalnumeric.py in <module>()
----> 1 from gdal_array import *
2 from numpy import *
/home/nobody/anaconda/lib/python2.7/site-packages/osgeo/gdal_array.py in <module>()
23 fp.close()
24 return _mod
---> 25 _gdal_array = swig_import_helper()
26 del swig_import_helper
27 else:
/home/nobody/anaconda/lib/python2.7/site-packages/osgeo/gdal_array.py in swig_import_helper()
15 fp, pathname, description = imp.find_module('_gdal_array', [dirname(__file__)])
16 except ImportError:
---> 17 import _gdal_array
18 return _gdal_array
19 if fp is not None:
ImportError: No module named _gdal_array
On Windows using the 32-bit version of Anaconda 1.9.1, the same version of GDAL works. Poking around on my Linux system, I found that the vendor-supplied GDAL Python package includes the following *gdal_array* files:
/usr/lib64/python2.6/site-packages/osgeo/gdal_array.pyc
/usr/lib64/python2.6/site-packages/osgeo/_gdal_array.so
/usr/lib64/python2.6/site-packages/osgeo/gdal_array.pyo
/usr/lib64/python2.6/site-packages/osgeo/gdal_array.py
However, the Anaconda installation contains only the .pyc and .py files:
./pkgs/gdal-1.10.1-py27_0/lib/python2.7/site-packages/osgeo/gdal_array.py
./pkgs/gdal-1.10.1-py27_0/lib/python2.7/site-packages/osgeo/gdal_array.pyc
./lib/python2.7/site-packages/osgeo/gdal_array.py
./lib/python2.7/site-packages/osgeo/gdal_array.pyc
Thus, it seems as though the Linux .so (and .pyo?) file wasn't built or included in the Anaconda GDAL package. As I am not using a personally owned system, software installation for me is generally a long and involved process. I, and the other GDAL users, would greatly appreciate it if Continuum could rectify this GDAL issue.