- If you don’t have Anaconda installed, install it from here. This will use up to 6GB of disk space and might take some time. A less heavy alternative is Miniconda.
- Download PyPSA-Eur as a zip (and extract it) or using GitHub (if you are familiar with git).
- Launch “Anaconda Prompt (Anaconda3)” from the Start Menu if using Windows. On Linux/Mac, open a terminal (making sure
condais available, if not add its path in the PATH environment variable). - If the prompt starts with
(base), typeconda deactivatepress Enter and make sure
(base)disappears. - Type
conda update -n base condathen press Enter and follow the instructions to update conda (might need Admin rights depending on where Anaconda was installed).
- Type
conda install -n base conda-libmamba-solverthen press Enter and follow the instructions to install a conda setup library faster than the default one.
- Go to the path where you unzipped/cloned PyPSA-Eur, e.g.:
cd "C:\Users\SomeUserName\Documents\pypsa-eur"
- Type
conda env create --experimental-solver=libmamba -f envs/environment.yamlthen press Enter and follow the instructions to create the Python environment to use to run PyPSA-Eur.
- Type
conda install -n pypsa-eur -c conda-forge --experimental-solver=libmamba jupyterlabthen press Enter and follow the instructions to install Jupyter Lab (the suggested development environment to run and interact with the model).
- Type
conda install -n pypsa-eur -c gurobi --experimental-solver=libmamba gurobithen press Enter and follow the instructions to install the Gurobi solver.
- Get a free Gurobi academic license here. Then go to your current Gurobi licenses, click on an available license and copy the command that starts with
grbgetkeyfollowed by a long hexadecimal key (appearing at the bottom of the page). - Type
conda activate pypsa-eurthen press Enter to start the PyPSA-Eur Python environment.
- Type
grbgetkey long-hexadecimal-key-copied-from-gurobi-websitethen press Enter and follow the instructions to activate the Gurobi key on your computer.
- Launch “Anaconda Prompt (Anaconda3)” from the Start Menu if using Windows. On Linux/Mac, open a terminal (making sure
condais available, if not add its path in the PATH environment variable). Then type:conda activate pypsa-eurand press Enter to start the PyPSA-Eur Python environment.
- If not already located in the path where PyPSA-Eur was placed, cd into it, e.g.
cd "C:\Users\SomeUserName\Documents\pypsa-eur"
- Type
jupyter labthen press Enter to launch the web interface through which you can interact with the model.
- Open Jupyter Lab as explained in section 2.
- Right click on the file
config.default.yamlthen duplicate. - Right click on the duplicated file, then rename it to
config.yaml. - Double click on
config.yamlto edit it. - Change the line
clusters: [37, 128, 256, 512, 1024]to
clusters: [37] - Change the line
opts: [Co2L-3H]to
opts: [Co2L-24H] - File -> Save
- File -> Close all tabs
- From the launcher within Jupyter Lab, launch a new terminal
- Type
snakemake -j1 solve_all_networksthen press Enter to start downloading all the data files and eventually solve the network. This will take some time and use up to ~20GB of space! For a smaller footprint run just the tutorial as explained in the section below.
- Open Jupyter Lab as explained in section 2.
- Right click on the file
config.tutorial.yamlthen duplicate. - Right click on the duplicated file, then rename it to
config.yaml. - Double click on
config.yamlto edit it. - Change the line
name: cbcto
name: gurobi - File -> Save
- File -> Close all tabs
- From the launcher within Jupyter Lab, launch a new terminal
- Type
snakemake -j1 solve_all_networksthen press Enter to start downloading all the tutorial data files and eventually solve the network.