Nate
Nate

Reputation: 798

Installing GDAL for Python

I am trying to install GDAL for python on a Windows XP machine (Python 2.6 currently installed) following the instructions at http://trac.osgeo.org/gdal/wiki/GdalOgrInPython (as is mirrored in a hundred other places). It says I need both the GDAL source (or Windows binary) and the python bindings. The python binding are be downloaded from the python cheeseshop (http://pypi.python.org/pypi/Python_GDAL/1.3.1). I don't see a download link on this page nor can I locate the python binding elsewhere - all instruction I can find seem to point to the same cheeseshop page. This seems like I'm either missing something embarrassingly simple or the bindings file has disappeared. Any thoughts on which it is? Thanks.

Upvotes: 1

Views: 6303

Answers (6)

Oyiwai
Oyiwai

Reputation: 459

For windows:

  1. run python from cmd and find your version
  2. go to http://www.gisinternals.com/release.php and download core components + bindings
  3. Add core components installation dir to environment's Path (it's been defaulted to C:\Program Files\GDAL for me)

    1. For windows:
  4. run python from cmd and find your version

  5. go to http://www.gisinternals.com/release.php and download core components + bindings
  6. Add core components installation dir to environment's Path (it's been defaulted to C:\Program Files\GDAL for me)
  7. add a new system environment 'GDAL_DATA' with 'C:\Program Files\GDAL\data' as value
  8. add 'from osgeo import gdal' in your code

Upvotes: 0

avee
avee

Reputation: 776

This is a shameless plug, but you might want to check out my answer in this question:

Unable to install Python and GDAL (DLL load failed)

Upvotes: 0

Mehmet
Mehmet

Reputation: 11

Here is the website: http://pypi.python.org/pypi/GDAL/1.6.0#downloads

Just run the .exe for the python version installed on your computer.

Upvotes: 1

matt wilkie
matt wilkie

Reputation: 18084

if python 2.6 is not a pre-requisite the smoothest route to gdal+python is via OSGeo4W.

To install gdal 1.6 and pythone 2.5 run the setup program, choose Advanced, then select the shell, gdal16 and gdal16-python packages (the gdal 1.7 python package is not yet available).

Start the shell, run gdal16.bat (it will be in PATH) and you're ready.

Upvotes: 1

ViennaMike
ViennaMike

Reputation: 16

The latest GDAL for python seems to be 1.7, (http://pypi.python.org/pypi/GDAL/1.7.1) but contrary to what is says earlier on the cheeseshop page, there''s no windows installer version. At the very bottom, there's a tar.gz file with the code in it.

There IS a windows installer program for version 1.6. I don't know if that version runs with python 2.6, though. I found one source that said as of Feb. 2009, it didn't, but a later note at ucsb.pbworks.com/Using-GDAL-with-Python indicates it does. I've verified it intalls fine, and I can import it per directions on that page. I haven't done anything more yet.

Hope this helps!

Upvotes: 0

Related Questions