我正在尝试使用 Anaconda2 安装和测试 GDAL。我的python安装是2.7。我使用 Windows 二进制文件安装了 GDAL,我可以导入除 gdal_array 之外的所有 gdal 模块。当我尝试导入时,我收到以下错误:
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
我还使用 osgeo4w 安装了 gdal。当我从 osgeo4w shell 运行 python 时,我可以毫无问题地导入 gdal_array。如何设置 anaconda 以使用来自 osgeo4w 的 gdal 依赖项?