Skip to content

Latest commit

 

History

History
84 lines (62 loc) · 2.09 KB

setup_and_install.md

File metadata and controls

84 lines (62 loc) · 2.09 KB

Installation

1. Install package manager miniconda

Download the latest miniconda version here.

2. Clone repository

git clone https://github.com/chrwm/kfw-mastr.git

3. Set python path

Using command line
  1. Check what your python path is
echo %PYTHONPATH%
  1. Set python path to repository root
set PYTHONPATH=C:\path\to\your\folder_where_you_cloned_the_repo_into
Using Powershell
  1. Check what your python path is
echo $env:PYTHONPATH
  1. Set python path to repository root
$env:PYTHONPATH = "C:\path\to\your\python\modules"

4. Setup environment and install packages

In miniconda terminal: Navigate to the REPO_ROOT (the folder where you cloned the repo into) and run the conda code below:

conda install mamba -n base -c conda-forge
mamba env create -f environment.yaml

This yields a virtual environment named kfw-mastr with Python 3.11 and all necessary packages to run the code.

5. Install docker & create database

  1. Download docker for Windows here.
  2. Start docker as administrator.
  3. Open command line as administrator.
  4. Navigate to repo root.
  5. Run
docker-compose up

This creates the docker infrastructure.

Setup & prepare database for calculations

  1. In your IDE set kfw-mastr as environment.
  2. If you're using the miniconda terminal or command line to run the code, then make sure to activate the kfw-mastr environment with:
conda activate kfw-mastr
  1. From project root, run
python kfw_mastr/setup_database.py

This creates the database, downloads the Marktstammdatenregister, and sets up the basic tables for calculations.

Note: If python kfw_mastr/setup_database.py doesn't work, try to run it with path to config.yaml

python kfw_mastr/setup_database.py --config_path "C:\Users\user\your\favourite\path\config_file_can_have_any_name.yaml"