Skip to content

Instantly share code, notes, and snippets.

@adripo
Last active June 21, 2024 13:36
Show Gist options
  • Save adripo/fd36961191487314283666b8888c0c4b to your computer and use it in GitHub Desktop.
Save adripo/fd36961191487314283666b8888c0c4b to your computer and use it in GitHub Desktop.
PyPSA-eur Installation Guideline

Details

Project: https://github.com/PyPSA/pypsa-eur

Setup 🔧

Git

  1. Download Git

https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe

  1. Install Git

Select ‘Next’ for all the options.

  1. Create project folder

Name it PyPSA and open it.

  1. Open git bash

Right-click and open Git Bash

  1. Clone the repository

git clone https://github.com/PyPSA/pypsa-eur

Python

  1. Download Python 3.10

https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe

  1. Install Python

Select ‘Install Now

Mamba

  1. Download Miniforge

https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe

  1. Install

  1. Set PATH

Open Win + R and Open the following command rundll32 sysdm.cpl,EditEnvironmentVariables

Edit Path.

Add new entry for C:\ProgramData\miniforge3\condabin\ and Save

Environment setup

  1. Open cloned folder

  2. Open cmd in folder

Write cmd in the Address Bar and press Enter

  1. Run mamba

In the terminal type the following:

mamba env create -f envs/environment.yaml

mamba activate pypsa-eur

Cbc Solver

  1. Download

https://www.coin-or.org/download/binary/Cbc/Cbc-master-win64-msvc16-md.zip

  1. Copy

Open zip and copy the contents of the bin directory

2024-06-21_15-25-59-189_WindowsSandboxClient

  1. Paste

Paste copied files in C:\ProgramData\miniforge3\envs\pypsa-eur\Library\bin 2024-06-21_15-27-07-837_WindowsSandboxClient

Replace if there are conflicts

HiGHS Solver

  1. Install

In the same cmd terminal run:

pip install highspy

conda install -c conda-forge glpk

conda install -c conda-forge coincbc

Run 🛬

Execute snakemake command

Open cmd like before in the cloned folder

mamba activate pypsa-eur

snakemake -call results/test-elec/networks/elec_s_6_ec_lcopt_.nc --configfile config/test/config.electricity.yaml

Continue with your configurations following the tutorial: https://pypsa-eur.readthedocs.io/en/latest/tutorial.html

Good luck!🍀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment