Install gdal under Windows python

Source: Internet
Author: User

First: Compiling preparation

Download each required installation package

Gdal's Src:http://trac.osgeo.org/gdal/wiki/downloadsource

Compile the exe:http://www.swig.org/required by Swig


Second: Compiling gdal

Open the nmake.opt modification under the Gdal folder Gdal_home = "C:/warmerda/bld" To change the path to the place where you need to install the gdal.

You can do it without change. If you need Python support to modify Pydir = "C:/python26" and modify SWIG = C:/swig The extracted directory/swig.exe

To run the VS command prompt, enter the VS console in turn:

nmake/f MAKEFILE.VC #编译

nmake/f MAKEFILE.VC Install #安装运行需要的东西

nmake/f MAKEFILE.VC Devinstall #安装开发需要的东西

Access to Gdal directory/swig

Run nmake/f makefile.vc python


Third: Install the Python gdal package

Another Open Win's console (CMD), into the Gdal directory/swig/python.

Run

Python setup.py Build

Python setup.py insatll (if run is unsuccessful, copy Python entire directory to root directory and try again)


If no surprises, Python's gdal should be installed successfully.


go to the Python import gdal test

From OSGeo import ogr

From OSGeo import gdal see if the module is properly installed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.