- 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
conda
is available, if not add its path in the PATH environment variable). - If the prompt starts with
(base)
, typeconda deactivate
press Enter and make sure
(base)
disappears. - Type
conda update -n base conda
then 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-solver
then 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.yaml
then 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 jupyterlab
then 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 gurobi
then 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
grbgetkey
followed by a long hexadecimal key (appearing at the bottom of the page). - Type
conda activate pypsa-eur
then press Enter to start the PyPSA-Eur Python environment.
- Type
grbgetkey long-hexadecimal-key-copied-from-gurobi-website
then 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
conda
is available, if not add its path in the PATH environment variable). Then type:conda activate pypsa-eur
and 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 lab
then 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.yaml
then duplicate. - Right click on the duplicated file, then rename it to
config.yaml
. - Double click on
config.yaml
to 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_networks
then 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.yaml
then duplicate. - Right click on the duplicated file, then rename it to
config.yaml
. - Double click on
config.yaml
to edit it. - Change the line
name: cbc
to
name: gurobi
- File -> Save
- File -> Close all tabs
- From the launcher within Jupyter Lab, launch a new terminal
- Type
snakemake -j1 solve_all_networks
then press Enter to start downloading all the tutorial data files and eventually solve the network.