Skip to content

βš™οΈ Environment Setup for Dataset Download

To download and process datasets, you need to set up a Python environment with geospatial libraries such as GDAL, Rasterio, and Xarray.

1: On Local PC

Conda is a cross-platform environment manager that makes it easy to install geospatial libraries like GDAL.

Windows

  1. Download the Miniconda installer:
    πŸ‘‰ Miniconda Windows 64-bit
  2. Run the installer and choose β€œAdd Miniconda to PATH” during setup.
  3. After installation, open Anaconda Prompt or Command Prompt and test:
conda --version

MacOS OS

  1. Download the installer for macOS from:
    πŸ‘‰ Miniconda macOS

  2. Run the installer

  3. Restart terminal and verify:

conda --version

2: Create a Conda Environment

conda create --name eqipa_env python=3.10
conda activate eqipa_env

3: Install GDAL and Geospatial Libraries

Use the conda-forge channel:

conda install -c conda-forge gdal libgdal-jp2openjpeg 

Verify GDAL installation:

gdalinfo --version

Then install required Python libraries:

conda install pandas tqdm geopandas numpy xarray rioxarray rasterio netCDF4 requests

4: Enable Jupyter Notebook Support (Optional)

conda install -c conda-forge notebook ipykernel
python -m ipykernel install --user --name=eqipa_env --display-name "Python (eqipa_env)"

To select the environment kernel in Jupyter: Kernel β†’ Change Kernel β†’ Python (eqipa_env)

Optional Cleanup: If you ever want to remove the kernel, use:

jupyter kernelspec uninstall eqipa_env


Optional: Save Environment for Future Use

conda env export > eqipa_env.yml

Others can recreate the environment with:

conda env create -f eqipa_env.yml

On Ubuntu (Without Conda)

1. Install GDAL system packages

sudo apt-get install gdal-bin libgdal-dev libspatialindex-dev

2. Create and Activate a Python Virtual Environment

python3 -m venv venv
source venv/bin/activate

3. Install Required Python Libraries

pip install pandas tqdm geopandas numpy xarray rioxarray rasterio netCDF4

You can create a requirements.txt for reuse:

pandas
tqdm
geopandas
numpy
xarray
rioxarray
rasterio
netCDF4

Install with:

pip install -r requirements.txt

βœ… Next Step

Once the environment is set up, proceed to the dataset you want to download.