ArcGIS, GDAL/OGR, General, Python, Tutorial

Installing GDAL / OGR for Python on Windows

Installing GDAL/OGR for Python on Windows is now even easier!

If you are doing Python development, you may be interested in my Windows Dev Stack, which describes my development environment from high level technologies down to specific apps, and how they all work together.

Christoph Gohlke, through his Unofficial Windows Binaries for Python Extension Packages, provides a number of libraries as Python Wheel files, which you can easily install to your desired Python… Unlike some other installers this installer includes GDAL, its data and the Python bindings all in the one installer.


1. Determine your desired Python install and version
2. Download the GDAL installer/bindings
3. Install
4. Notes

1. Determine your desired Python install and version

See the post on Locating Python and adding it to your system Path for information about how to find the Python install you wish to use (you do not need to add it to your system Path to continue with the steps below).

Once you have figured out which Python you are going to use, open the Python interpreter in your normal way (or double click on its python.exe). It will print version information at the top when it opens, for example: Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32

The important information is highlighted above: my version is Python 2.7 (the additional .10 is not important) and its architecture is 32 bit.

2. Download the GDAL installer/bindings

Go to and select the appropriate download corresponding to your Python version. Unless you specifically need an older version you might as well download the latest GDAL version. The filename has the format:

  GDAL-[GDAL version]-cp[python version]-none-[architecture].whl

So, based on the example above, I would download:


3. Install

Wheel files are installed using pip, a package manager for Python that is included in the default install. The syntax is (if the Python you want to install to is on your system path):

  python -m pip install GDAL-[etc.].whl


  [path to your desired python.exe] -m pip install GDAL-[etc.].whl

The python -m pip command is the preferred means of accessing pip (compared to the older style of having pip on the path and calling it directly), as it is more clear which Python pip is installing to.

4. Notes

Test your install by opening Python and entering:

  import ogr

This should return nothing (meaning no errors).


12 thoughts on “Installing GDAL / OGR for Python on Windows

  1. If you use the ‘Gohlke approach’, you might face problems with the command-line use of GDAL/OGR – because the Gohlke whl puts all of the GDAL/OGR stuff under [PYTHONPATH]\Lib\site-packages\osgeo

    So you’ll need to ensure that your environment variables match that (easiest way: search for , and you’ll also need to move ogr_FileGDB.dll from [PYTHONPATH]\Lib\site-packages\osgeo\plugins to [PYTHONPATH]\Lib\site-packages\osgeo – without changing the GDAL_DRIVER_PATH if it’s set.

  2. Great work!
    Some adjusments might be needed in Windows registry. In my case it was creating some conflict with the invasive ArcGIS python installation (including the DLL load Failed: %1 … error) when executing scripts from DOS shell. After some google search I found this very useful code repo:
    Also look at the last entry here about creating registry keys in Windows 7 x64:

  3. Any idea regarding a GDAL .whl file for Python32? Currently scripting with an API that solely supports Python32 and I cannot find it anywhere.

    1. You could try some advanced Google searching for the .whl file name (without the GDAL version) – someone might be serving it. Otherwise you should be able to do it “the hard way”: compiling from the source against Python 3.2

  4. Thank you so much. I wasted my whole day in installation, and in the end i follow your instructions and it works great and easy.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s