从ArcGIS for Desktop的Python窗口导入GDAL?
我正在尝试使用同时使用arcpy和gdal模块的ArcGIS 10.1中的Python窗口运行一些Python代码。但是,当我尝试导入gdal模块时,出现错误: ImportError: No module named osgeo 显然,它找不到该模块,因此我将主要的python site-packages目录添加到了sys.path列表中: sys.path.append(r"C:\Python27\lib\site-packages") 但是,当我尝试运行import osgeo或from osgeo import gdal出现以下错误时: Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 21, in <module> _gdal = swig_import_helper() File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper _mod = imp.load_module('_gdal', fp, pathname, description) ImportError: …