Creating the Python Environment

To install all required packages, it is recommended to build a virtual environment and load all python packages via pip, anaconda or mamba.
This is a brief collection of helpful resources and code snippets to create such virtual environments.


Create a virtual environment based on a .txt file via pip

In order to synchronize all python dependencies one recommended option is to install all packages from a requirements.txt file which can be found in the  GitHub repository.  Please use and adjust the following code snippets as needed. Note, commands depend on your operating system.

# navigate to the directory that contains the requirements.txt file
# check python version to ensure it is any 3.9 version, if not install it
python3 -V
# create a virtual environment named e.g. .climatematch, here macOS & Unix
python3 -m venv .climatematch
# windows
# py -m venv .climatematch
# list all hidden files and folders like .climatematch
ls -a
# activate virtual environment, here macOS & Unix
source .climatematch/bin/activate
# windows
# .climatematch\Scripts\activate
# update pip if necessary
pip install --upgrade pip
# install required packages from txt file
pip install -r requirements.txt


Create a conda environment based on a .yml or .txt file

A second option is to use conda or mamba to create an environment from a provided .yml file.
# navigate to the directory that contains the environment.yml file,
# likely the forked repository

# create env from yml file
conda env create -f environment.yml
# or another option faster, if mamba is installed properly
mamba env create -f environment.yml
# name of env in line 1 of .yml file, here climatematch
conda activate climatematch

# also possible creation via txt file
# but have to add the env name
mamba create -n climatematch --file requirements.txt

Note, this can take up to 1 hour processing time.
Please, find more detailed explanations  here .