|||
在搭建python和GDAL开发环境的时候,遇到这个问题:
我的python是随ARCGIS 10.2安装的,版本为“Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32”,系统为win7 64位。
经查阅资料,发现问题是因为GDAL版本与PYTHON版本不匹配造成的。
应安装gdal-111-1500-core.msi 和 GDAL-1.11.3.win32-py2.7.msi
安装和配置过程,可参考下文。先安装core,再安装GDAL python bindings。
Condensed procedure outlined in http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/ for Windows 7, 32 Bits, to install GDAL PYTHON:
1) Install Python.
I installed Python 2.7.9 from https://www.python.org/
2) Install the GDAL binaries published by Tamas Szekeres.
First, I launched IDLE (Python GUI) noting the following values: "MSC v.1500" and "on win32":
In this link: http://www.gisinternals.com/release.php
Click in the magenta link of the below image:
Click in the magenta links of the below image for download and install gdal-111-1500-core.msi andGDAL-1.11.1.win32-py2.7.msi:
3) Append your environment Path variable
After click in Edit and search for Path, add:
;C:Program FilesGDAL
DON'T FORGET the ; character before C:Prog... and click OK three times:
4) Add the GDAL_DATA environment variable (one click in New for each variable: gdal-data andgdalplugins)
DON'T FORGET click OK three times:
5) Finally, perform a quick test to make sure everything worked.
Launch IDLE (Python GUI) and type from osgeo import gdal [Enter]:
I didn't get gdal ImportError in python on my Windows 7 system.
Note: import gdal is deprecated.
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-2 06:31
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社