Installing GDAL using conda

Using conda to install GDAL gives you more flexibility in choosing a preferred Python version than Anaconda3. If you open up a terminal, you can use the conda search gdal command to print a list of available gdal versions and the corresponding Python version. If you want to know the dependencies for each package, type conda info gdal. Particular versions of GDAL depend on a specific package version, which can be a problem if you have these already installed, for example, NumPy. Then, you can create a virtual environment to install and run GDAL and their dependencies with the accompanying Python version, for example:

(C:\Users\<UserName> conda create -n myenv python=3.4(C:\Users\<UserName> activate myenv # for Windows ...

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.