Installing GDAL using Anaconda3

If you're using Anaconda3, the easiest way to install GDAL is to create a virtual environment through Anaconda Navigator, choosing Python 3.6 as the preferred version. Then, choose gdal from the list of uninstalled Python packages. This will install gdal version 2.1.0.

After installation, you can check if everything works OK by entering a Python shell and typing:

>> import gdal>> import ogr

You can check GDAL's version number as follows:

>> gdal.VersionInfo() # returns '2010300'

This means you're running GDAL version 2.1.3.

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.