Select to view content in your preferred language

How to install GDAL Library

10465
6
Jump to solution
10-13-2012 03:13 AM
irinivozinaki
Deactivated User
Please help me! I am confused.

I want to import GDAL library into python code.
There is a message that there is no module named GDAL.
I have tried to install GDAL for Python on Windows according to this guide http://www.gis.usu.edu/~chrisg/python/2009/docs/gdal_win.pdf

but nothing happens.

Please could you help me? Thank you very much!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
irinivozinaki
Deactivated User
Thanks very much for your help...

I also found the following advice which was proved to be helpful.

http://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/#com...

View solution in original post

0 Kudos
6 Replies
Luke_Pinner
MVP Regular Contributor
Those instructions and the version of GDAL they link to are very old. The GDAL project no longer provides windows binaries (link). You can install GDAL from gisinternals.com. Download gdal-19-1500-core.msi and GDAL-1.9.1.win32-py2.X.exe (replace 2.X with 2.7 if you have ArcGIS 10.1 or 2.6 for ArcGIS 10.0).
0 Kudos
JasonScheirer
Esri Alum
0 Kudos
irinivozinaki
Deactivated User
Unfortunately the following message appears still in my screen when I am trying to import GDAL

"Runtime error <type 'exceptions.ImportError'>: DLL load failed: The specified module could not be found"
0 Kudos
irinivozinaki
Deactivated User
Thanks very much for your help...

I also found the following advice which was proved to be helpful.

http://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/#com...
0 Kudos
KevinNetherton
Emerging Contributor
Hello,

I'm trying to get the gdal/ogr modules installed.  I've downloaded the gdal/ogr binaries and the python bindings, and put in a directory.  I'm using the gdal version that is bunded with the ms4w package here:

http://www.maptools.org/ms4w/index.phtml

After downloading I've pulled the various files out and created a gdal directory with the following directories:
bin (the various gdal tools and dll's), data (gdal data directory), plugins (additional drivers like sde filegdb etc), projlib (files used by proj4), python (the python bindings)

In my script i add the plugins, bin, to os.environ['PATH']

after doing this I can successfully import osgeo.ogr, use the tools etc.  No problem.

So now I add the 'import arcpy' line at the top of my script.  When I do this my subsequent attempts to import osgeo.ogr give me this error:

_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: DLL load failed: The specified procedure could not be found.

If I try to import arcpy after I've imported osgeo.ogr, python crashes.  The crash creates a popup saying python.exe has stopped working, blah blah.

The details indicate the fault module Name is 'RasterDB.dll'

Anyone have a recipe for installing gdal/ogr so that it works with arcpy?  Suggestions on how to arcpy and OGR to work in the same script?

Thanks

Kevin

P.S. you can download a complete bundle of the dependencies and the python script that demonstrates the issue here:
https://docs.google.com/file/d/0B6ehdNnpIAs5bzk0Y09pdG5aNWc/edit?usp=sharing

The script test_arcpy_and_gdal.py will demonstrate the problem.
0 Kudos
irinivozinaki
Deactivated User
Try to read the whole procedure described in the link I have proposed above...  It is really helpful.

Hope it works!
0 Kudos