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 开发者_JAVA百科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.
Are you looking for this?
- http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries
- http://trac.osgeo.org/gdal/wiki/DownloadSource
Found at http://www.remotesensing.org/gdal/
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.
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.
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!
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)
For windows:
- run python from cmd and find your version
- go to http://www.gisinternals.com/release.php and download core components + bindings
Add core components installation dir to environment's Path (it's been defaulted to C:\Program Files\GDAL for me)
- For windows:
run python from cmd and find your version
- go to http://www.gisinternals.com/release.php and download core components + bindings
- Add core components installation dir to environment's Path (it's been defaulted to C:\Program Files\GDAL for me)
- add a new system environment 'GDAL_DATA' with 'C:\Program Files\GDAL\data' as value
- add 'from osgeo import gdal' in your code
精彩评论