Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Preparing the tools you need for SDS320

1. Why this setup matters

A stable software setup saves time during project work. Spatial analytics projects often combine GeoAI tools, geospatial libraries, machine learning packages, notebooks, scripts, model outputs and external data. If your environment and folder structure are unclear, small technical problems can become difficult to diagnose.

The goal of this page is to guide you through a coherent setup pathway:

  1. create a clear SDS320 folder structure,

  2. install Miniconda or Anaconda,

  3. create the course Conda Environment,

  4. connect the environment to VS Code,

  5. check that the core packages work,

  6. know what to check first when something breaks.


2. Organise your SDS320 folders

Before you download the environment file, create one clear working area for SDS320. This helps separate course exercises from your own project and makes it easier to use relative paths later.

The suggested structure has two main parts:

Within both parts, data are separated into:

sds320/
├── README.md
├── course/
│   ├── README.md
│   ├── environment.yml
│   ├── data/
│   │   ├── README.md
│   │   ├── raw/
│   │   │   ├── swissimage/
│   │   │   ├── sentinel2/
│   │   │   ├── landsat/
│   │   │   ├── naip/
│   │   │   └── vectors/
│   │   ├── processed/
│   │   └── training/
│   ├── models/
│   ├── notebooks/
│   ├── scripts/
│   └── results/
│       ├── figures/
│       ├── maps/
│       ├── predictions/
│       └── evaluation/
└── project/
    ├── README.md
    ├── environment.yml
    ├── .gitignore
    ├── data/
    │   ├── README.md
    │   ├── raw/
    │   │   ├── raster/
    │   │   └── vectors/
    │   ├── processed/
    │   └── training/
    ├── models/
    ├── notebooks/
    ├── scripts/
    └── results/
        ├── figures/
        ├── maps/
        ├── predictions/
        └── evaluation/

The additional files are useful for reproducibility:

Create the folders

Copy the command for your platform into a terminal. Run it in the location where you want to store your SDS320 work, for example your Documents folder.

Windows PowerShell
macOS / Linux

Open PowerShell and navigate to the folder where you want to create your SDS320 working area.

$folders = @(
  "sds320\course\data\raw\swissimage",
  "sds320\course\data\raw\sentinel2",
  "sds320\course\data\raw\landsat",
  "sds320\course\data\raw\naip",
  "sds320\course\data\raw\vectors",
  "sds320\course\data\processed",
  "sds320\course\data\training",
  "sds320\course\models",
  "sds320\course\notebooks",
  "sds320\course\scripts",
  "sds320\course\results\figures",
  "sds320\course\results\maps",
  "sds320\course\results\predictions",
  "sds320\course\results\evaluation",
  "sds320\project\data\raw\raster",
  "sds320\project\data\raw\vectors",
  "sds320\project\data\processed",
  "sds320\project\data\training",
  "sds320\project\models",
  "sds320\project\notebooks",
  "sds320\project\scripts",
  "sds320\project\results\figures",
  "sds320\project\results\maps",
  "sds320\project\results\predictions",
  "sds320\project\results\evaluation"
)

foreach ($folder in $folders) {
  New-Item -ItemType Directory -Force -Path $folder | Out-Null
}

$files = @(
  "sds320\README.md",
  "sds320\course\README.md",
  "sds320\course\environment.yml",
  "sds320\course\data\README.md",
  "sds320\project\README.md",
  "sds320\project\environment.yml",
  "sds320\project\.gitignore",
  "sds320\project\data\README.md"
)

foreach ($file in $files) {
  New-Item -ItemType File -Force -Path $file | Out-Null
}

What to put where

LocationUse for
course/environment.ymlThe official SDS320 course environment file.
course/notebooks/Course notebooks, setup checks and small experiments.
course/data/raw/Original datasets used in course examples.
course/results/Outputs from course examples and setup checks.
project/environment.ymlThe environment used for your own project. This can start as a copy of the course environment.
project/README.mdThe main explanation of your final project repository.
project/data/raw/Original project data. Do not modify these files directly.
project/data/processed/Data changed by preprocessing, such as clipping, reprojection or merging.
project/data/training/Image chips, labels, masks or other model-ready training data.
project/scripts/Reusable Python scripts and helper functions.
project/notebooks/Exploratory notebooks and project analysis notebooks.
project/results/Final or intermediate outputs such as maps, predictions, figures and evaluation results.

3. Software recommendations

For SDS320, you should have access to:

If there is a good overlap between the packages you intend to use, you can use the same environment file for your SDS320 project to create a seperate sds320-project environment later on. Otherwise, I would recommend either selecting a subset or starting from scratch.


4. Hardware and OS recommendations

Most SDS320 work can be done on a normal laptop, especially when working with small examples, pre-trained models or limited study areas.

For heavier model training, larger image collections or repeated inference, hardware becomes more important.

ComponentMinimum for small examplesRecommended for heavier GeoAI work
ProcessorModern multi-core CPURecent multi-core CPU
Memory8 GB RAM16–32 GB RAM
Storage20 GB free disk spaceSSD with 50 GB or more free disk space
Operating systemWindows 10/11, macOS 14+, or recent LinuxSame
GPUNot required for small examplesNVIDIA GPU with sufficient VRAM for model training

5. Setup pathway

Follow the steps below in order.

Create folders
→ install Miniconda or Anaconda
→ create the sds320 environment
→ activate the environment
→ connect it to VS Code
→ verify packages, GPU/CPU and maps
→ document the setup in your project

A. Install Miniconda or Anaconda

Conda is recommended because geospatial Python packages often depend on compiled libraries such as GDAL/OGR, PROJ and GEOS. Conda can install many of these dependencies together, which usually avoids compatibility problems.

Use Miniconda as a lightweight installation. For a more detailed setup description follow the SDS210 Conda setup.

Windows
macOS Apple Silicon
macOS Intel
Linux

Open PowerShell. The GeoAI setup chapter recommends running PowerShell as administrator for the command-line installer.

curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o .\miniconda.exe
start /wait "" .\miniconda.exe /S
del .\miniconda.exe

Then close PowerShell. Open Anaconda Prompt (Miniconda3) from the Start menu and check the installation:

conda --version
python --version

You should see version numbers rather than an error message.


B. Save the SDS320 environment file

Download the course environment.yml file and save it here here:

sds320/course/environment.yml

If your own project uses the same environment, copy the file later to:

sds320/project/environment.yml

This makes the project easier to reproduce because the software requirements are documented inside the project folder.


C. Create the SDS320 environment

Open a terminal in the sds320/course/ folder, where the course environment.yml file is saved.

Check that the file is there:

Windows Anaconda Prompt
macOS / Linux
cd path\to\sds320\course
dir

Then create the environment:

conda env create -f environment.yml

This creates an environment called sds320.

Activate it with:

conda activate sds320

Your terminal prompt should now include:

(sds320)

This means that Python commands run from this terminal use the SDS320 environment.

To deactivate the environment later, use:

conda deactivate

D. Optional: update the environment

If the course environment file changes later, update your environment from the folder that contains environment.yml:

conda env update -f environment.yml --prune

The --prune option removes packages that are no longer listed in the file.


E. Optional: GPU and CUDA setup

Some GeoAI and deep learning workflows are faster with CUDA support. CUDA is relevant only for compatible NVIDIA GPUs.

You can skip this section if:

Check your pathway

Windows with NVIDIA GPU
macOS Apple Silicon
macOS Intel
Linux

Install or update the NVIDIA driver using one of these options:

  • download the driver from the NVIDIA driver website,

  • or use Windows Update under optional updates.

After installation, restart your computer and run:

nvidia-smi

If the command displays your GPU model and driver version, the driver is available.

Then check PyTorch from inside the sds320 environment:

conda activate sds320
python -c "import torch; print(torch.cuda.is_available())"

If this prints True, PyTorch can access CUDA. If it prints False, the environment may be using a CPU-only PyTorch build, or the NVIDIA driver may not be available.


F. Optional: cloud alternatives

If your local computer struggles with larger models, cloud notebooks can provide GPU access.

Possible options include:

In this course we will use Colab, as Kaggle has restrictions for the Leafmap interactive mapping library.


G. Install and configure VS Code

VS Code is useful for editing scripts, Markdown files, YAML files, README files and notebooks.

Download VS Code from: https://code.visualstudio.com

For a detailed setup description follow the SDS210 VS Code setup.

After opening your SDS320 folder in VS Code:

  1. open the Command Palette (Win: Ctrl + Shift + P, Mac: Cmd + Shift + P),

  2. choose the Python interpreter or notebook kernel,

  3. select the sds320 environment,


H. Check Git

Check whether Git is installed:

git --version

You should see a version number.

If Git is not available, install it from the official Git website or through your operating-system package manager.

For a detailed Git setup description follow the instructions at SDS210

You will use Git more fully in Git basics. For now, the goal is only to confirm that the command is available.


I. Verify your setup

After activating the environment, run the following checks.

Check Python and the active environment

conda activate sds320
python --version
conda info --envs

The active environment should be marked with an asterisk.

Check important packages

Create a notebook called:

sds320/course/notebooks/setup_check.ipynb

Run this code cell:

import importlib
import sys

print(f"Python version: {sys.version}\n")

packages = {
    "numpy": "NumPy",
    "pandas": "Pandas",
    "geopandas": "GeoPandas",
    "rasterio": "Rasterio",
    "rioxarray": "Rioxarray",
    "xarray": "Xarray",
    "matplotlib": "Matplotlib",
    "sklearn": "scikit-learn",
    "torch": "PyTorch",
    "torchvision": "TorchVision",
    "geoai": "GeoAI",
    "leafmap": "Leafmap",
    "folium": "Folium",
}

for module_name, display_name in packages.items():
    try:
        module = importlib.import_module(module_name)
        version = getattr(module, "__version__", "installed")
        print(f"{display_name}: {version}")
    except ImportError:
        print(f"{display_name}: NOT FOUND")

If a package shows NOT FOUND, first check that the notebook is using the correct sds320 kernel.

Check PyTorch and acceleration

Run:

import torch

print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")

if torch.cuda.is_available():
    print(f"GPU device: {torch.cuda.get_device_name(0)}")
elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
    print("Apple MPS available")
else:
    print("Running in CPU-only mode")

A CPU-only result is acceptable for many course tasks. For larger model training, discuss whether your project scope needs to be adjusted.

Check interactive maps

Run this in the same notebook:

import leafmap

m = leafmap.Map(center=[47.3769, 8.5417], zoom=10)
m

If an interactive map appears, your notebook and visualisation stack are working.


6. Flags & checks

Use this table before reinstalling packages.

Red flagFirst check
ModuleNotFoundError in a notebookCheck whether the notebook kernel is sds320.
Package works in terminal but not in notebookThe terminal and notebook probably use different Python environments.
conda activate sds320 failsCheck whether the environment was created successfully with conda info --envs.
environment.yml cannot be foundCheck that your terminal is in sds320/course/.
nvidia-smi is not foundYou may not have an NVIDIA GPU, or the NVIDIA driver is not installed.
CUDA is False but you expected GPU supportCheck NVIDIA driver, PyTorch build and active environment.
Leafmap does not displayTry restarting the kernel, check browser output and confirm that the correct environment is active.
Python cannot find a data filePrint your working directory and check relative paths.
Git is not foundInstall Git and restart the terminal.
Repository contains large raw dataUpdate .gitignore and document data downloads in data/README.md.

For more detail, see Troubleshooting.


7. Mini task

Before the first project work session, complete this checklist:


8. Key takeaways