winterkey的个人博客分享 http://blog.sciencenet.cn/u/winterkey

博文

gdal ImportError in python on Windows

已有 4078 次阅读 2015-12-10 11:13 |个人分类:数据处理技术|系统分类:科研笔记| Python, GDAL

在搭建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":

enter image description here

In this link: http://www.gisinternals.com/release.php

Click in the magenta link of the below image:

enter image description here

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:

enter image description here

3) Append your environment Path variable

enter image description here

enter image description here

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:

enter image description here

4) Add the GDAL_DATA environment variable (one click in New for each variable: gdal-data andgdalplugins)

DON'T FORGET click OK three times:

enter image description here

enter image description here

5) Finally, perform a quick test to make sure everything worked.

Launch IDLE (Python GUI) and type from osgeo import gdal [Enter]:

enter image description here

I didn't get gdal ImportError in python on my Windows 7 system.

Note: import gdal is deprecated.




https://blog.sciencenet.cn/blog-805713-942345.html

上一篇:希腊字母的手写体应该怎么写
收藏 IP: 59.172.176.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-18 16:16

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部