Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get python 2.7 to work with GDAL/OGR and an ESRI file geodatabase. There have been a few similar questions asked but the answers don't fully resolve my situation.

I have installed the 64-bit GDAL Core files from I have also installed the Python Bindings and the File GDB.

The background to the problem is that when I run ogrinfo --formats from the command line it returns: "FileGDB" (read/write), when I run ogr from the command line I can see the layers in the Geodatabase BUT when I try to use the following code in Python in returns "None"

driver = gdal.GetDriverByName('FileGDB')
ds = driver.Open(r"my file.gdb",0)
print driver

Ogr definitely works in python because the following code returns the correct response:

driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.Open(r"My Shapefile.shp",0)
print ds

driver = gdal.GetDriverByName('GTiff')
ds = driver.Open(r"My GeoTiff.shp",0)
print driver

Does anybody have any pointers to resolve this.


share|improve this question
I sense a slight confusion between OGR and GDAL. Try instead: ogr.GetDriverByName('FileGDB') – Mike T Jul 1 '13 at 4:01
I've tried that and still no joy. It still returns nothing instead of the SWIG object that it should. – user19466 Jul 2 '13 at 4:40
up vote 3 down vote accepted

I found the solution to this was to add GDAL_DRIVER_PATH = C:\Program Files\GDAL\gdalplugins in the Environment Variables.

This was in addition to Mike Toews comment about the correct usage being ogr.GetDriverByName('FileGDB')

share|improve this answer
Difficult find! This can also be set in Python with os.environ['GDAL_DRIVER_PATH'] = r'C:\...', either before importing ogr, or by calling ogr.RegisterAll() after setting the variable. – Mike T Jul 4 '13 at 4:41
I was using the pre-built Python GDAL Windows binaries, which don't require GDAL to be installed. In addition to setting GDAL_DRIVER_PATH to point at the location inside the site-packages directory, I had to ensure FileGDB.dll was on PATH. (I had to download FileGDB.dll from ESRI separately.) – jpmc26 Jan 7 '14 at 22:08

If you are interested in using the File Geodatabase API with Python, read my post:

Also, see the project page:

Enjoy! Joseph Armbruster

share|improve this answer
This question is specifically about GDAL bindings, so your self-promotion makes little sense here (as opposed to the other question). – lynxlynxlynx Feb 2 '14 at 8:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.