Skip to content

Instantly share code, notes, and snippets.

@jeremejazz
Last active May 20, 2025 01:00
Show Gist options
  • Save jeremejazz/02ea7626ec12a39a789f44db4a9ec49c to your computer and use it in GitHub Desktop.
Save jeremejazz/02ea7626ec12a39a789f44db4a9ec49c to your computer and use it in GitHub Desktop.
Installing Gdal with Anaconda

Installing GDAL with Anaconda

Here are steps to install GDAL in Anaconda with python bindings.

  1. Download and Install Anaconda (or Miniconda for minimal setup)
    • For Windows a shortcut to anaconda prompt will be created in the start menu which should open command prompt with conda activated.
    • For Linux/Mac you will be asked remove the automatic initialization, if you choose yes, you will need to manually run conda init <shell>.
      • Note: After initialization, conda will automatically activate the base environment by default everytime you open the terminal. If you don't prefer this configuration, run conda config --set auto_activate_base false
  2. (Optional. You can skip this step if you want to only use base environment) Create a Conda environment with python.
conda create -n geospatial python=3.11

To list environments

conda env list 

To activate an environment

conda activate geospatial
  1. Install GDAL
conda install -c conda-forge gdal
  1. Test your installation
gdalinfo --version 

Should output something like this

GDAL 3.4.1, released 2021/12/27

To test python bindings:

from osgeo import gdal
print(gdal.__version__)
@jeremejazz
Copy link
Author

jeremejazz commented May 20, 2025

update (2025-05-20):

  • additional note regarding conda init
  • update python 3.9 to 3.11 . Tried 3.13 but getting warning messages when running gdal2tiles.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment