GDAL_数组imp

2024-04-25 23:12:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装和测试GDAL与Python2。我的python安装是2.7。我使用windows二进制文件安装了GDAL,我可以导入除了GDAL_数组之外的所有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,当我从osgeo4wshell运行python时,可以毫无问题地导入gdal_数组。如何设置anaconda使用osgeo4w的gdal依赖项?在


Tags: inimporthelper数组arrayusersappdataswig