GDAL_ARRAY import error

1k views Asked by At

I am trying to install and test GDAL with Anaconda2. My python installation is 2.7. I installed GDAL using the windows binaries, and I can import all gdal modules except gdal_array. When I try to import, I get the following error:

ImportError                               Traceback (most recent call last)
<ipython-input-2-dfec89538ead> in <module>()
----> 1 from osgeo import gdal_array

C:\Users\r.roychowdhury\AppData\Local\Continuum\Anaconda2\lib\site-packages\osgeo\gdal_array.py in <module>()
     24                 fp.close()
     25             return _mod
---> 26     _gdal_array = swig_import_helper()
     27     del swig_import_helper
     28 else:

C:\Users\r.roychowdhury\AppData\Local\Continuum\Anaconda2\lib\site-packages\osgeo\gdal_array.py in swig_import_helper()
     16             fp, pathname, description = imp.find_module('_gdal_array', [dirname(__file__)])
     17         except ImportError:
---> 18             import _gdal_array
     19             return _gdal_array
     20         if fp is not None:

ImportError: No module named _gdal_array

I also installed gdal using osgeo4w. When I run python from the osgeo4w shell, I can import gdal_array without any issue. How can I set anaconda to use the gdal dependencies from osgeo4w?

0

There are 0 answers