Skip to content

pypsa-meets-earth/pypsa-earth

Repository files navigation

PyPSA-Earth. A Flexible Python-based Open Optimisation Model to Study Energy System Futures around the World.

by

Development Status: Stable and Active

Test workflows Documentation Status Size License: AGPL v3 REUSE status Code style: black pre-commit.ci status Discord Google Drive DOI

PyPSA-Earth: A Global Sector-Coupled Open-Source Multi-Energy System Model

PyPSA-Earth is the first open-source global cross-sectoral energy system model with high spatial and temporal resolution. The workflow provide capabilities for modelling the energy systems of any country in the world, enabling large-scale collaboration and transparent analysis for an inclusive and sustainable energy future. PyPSA-Earth is suitable for both operational studies and capacity expansion studies. Its sector-coupled modeling capabilities enable features for the detailed optimization of multi-energy systems, covering electricity, heating, transport, industry, hydrogen and more.

All the data needed for a simulation are automatically and flexibly retrieved from open sources. This includes, in particular, energy demand across sectors, generation capacities, medium- to high-voltage networks, and renewable energy potentials. Custom datasets can also be integrated as needed, and kept private if required. At the same time, PyPSA-Earth-Status provides functionality to share regional insights. If you are willing to contribute your regional expertise, feel free to open an issue there.

PyPSA-Earth is capable of providing the modelling evidence needed to translate the implications of energy scenarios into actionable regional strategies. By making this tool openly available, we aim to foster collaboration, innovation, and informed decision-making to support sustainable and efficient energy solutions worldwide.

Details on the model are available in the following academic publications:

  • power model M. Parzen et all. "PyPSA-Earth: A new global open energy system optimization model demonstrated in Africa", Applied Energy, 341, 2023. https://doi.org/10.1016/j.apenergy.2023.121096
  • sector-coupled model H. Abdel-Khalek et al. "PyPSA-Earth sector-coupled: A global open-source multi-energy system model showcased for hydrogen applications in countries of the Global South", Applied Energy, 383, 2025. https://doi.org/10.1016/j.apenergy.2025.125316

PyPSA meets Earth is an independent research initiative developing a powerful energy system model for Earth. We work on open data, open source modelling, open source solver support and open communities. Stay tuned and join our mission - We look for users, co-developers and leaders!

Figure: Example power systems build with PyPSA-Earth.
See images of ~193 more countries at Zenodo

The diagram below depicts one representative clustered node for the sector-coupled model with its generation, storage and conversion technologies.

Livetracker. Most popular global models:

How to get involved

There are multiple ways to get involved and learn more about our work:

  1. Join our Discord Server to connect in discussion channels, get help in the support forum, and join our meetings
  2. Chat on Discord with us in the following open meetings:
    • General initiative meeting for project news and high-level code updates. Held every fourth Thursday 16-17:00 (UK time) and is a perfect place to meet the community and get a high-level update on PyPSA ecosystem relevant for PyPSA-Earth developments.
    • Weekly developers meetings
      • Eastern-Hemisphere friendly Morning meeting every Thursday at 09:00 (UK time).
      • Western-Hemisphere friendly Evening meeting every Thursday 16:00 (UK time). Every forth Thursday is replaced by the General initiative meeting which has a more high-level perspective, but you can also join to discuss more particular questions.
  3. Look at public materials at google Drive to share to minutes, presentations, lists and documents. Feel gree to get a look!
  4. Notify your interest to on-demand meetings:
    • On-demand meetings
      • Demand creation and prediction meeting
      • AI asset detection meeting
      • Outreach meeting for planning, discussing events, workshops, communication, community activities
  5. Join us and propose your stream.

Installation

  1. Open your terminal at a location where you want to install pypsa-earth. Type the following in your terminal to download the package from GitHub:

       .../some/path/without/spaces % git clone https://github.com/pypsa-meets-earth/pypsa-earth.git
  2. The python package requirements are curated in the envs/environment.yaml file. The environment can be installed using:

    .../pypsa-earth % conda env create -f envs/environment.yaml

If the above takes longer than 30min, you might want to try mamba for faster installation:

    (base) conda install -c conda-forge mamba

    .../pypsa-earth % mamba env create -f envs/environment.yaml
  1. For running the optimization one has to install the solver. We can recommend the open source HiGHs solver which installation manual is given here.

  2. To use jupyter lab (new jupyter notebooks) continue with the ipython kernel installation and test if your jupyter lab works:

       .../pypsa-earth % ipython kernel install --user --name=pypsa-earth
       .../pypsa-earth % jupyter lab
  3. Verify or install a java redistribution from the official website or equivalent. To verify the successful installation the following code can be tested from bash:

       .../pypsa-earth % java -version

    The expected output should resemble the following:

       java version "1.8.0_341"
       Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
       Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

Running the model in previous versions

The model can be run in previous versions by checking out the respective tag. For instance, to run the model in version 0.6.0, which is the last version before the recent PyPSA update, the following command can be used:

git checkout v0.6.0

After checking out the tag, the model can be run as usual. Please make sure to use the environment built for the respective version.

Test run on tutorial

  • In the folder open a terminal/command window to be located at this path ~/pypsa-earth/

  • Activate the environment conda activate pypsa-earth

  • Rename config.tutorial.yaml to config.yaml. For instance in Linux:

    mv config.tutorial.yaml config.yaml
  • Run a dryrun of the Snakemake workflow by typing simply in the terminal:

    snakemake -j 1 solve_all_networks -n

    Remove the -n to do a real run. Follow the tutorial of PyPSA-Eur 1 and 2 on YouTube to continue with an analysis.

Training

  • We recently updated some hackathon material for PyPSA-Earth. The hackathon contains jupyter notebooks with exercises. After going through the 1 day theoretical and practical material you should have a suitable coding setup and feel confident about contributing.
  • The get a general feeling about the PyPSA functionality, we further recommend going through the PyPSA and Atlite examples.

Questions and Issues

  • We are happy to answer questions and help with issues if they are public. Through being public the wider community can benefit from the raised points. Some tips. Bugs and feature requests should be raised in the GitHub Issues. General workflow or user questions as well as discussion points should be posted at the GitHub Discussions tab. Happy coding.

Documentation

The documentation is available here: documentation.

Collaborators

FabianHofmann
FabianHofmann
fneum
fneum
ekatef
ekatef
euronion
euronion
Justus-coded
Justus-coded
mnm-matin
mnm-matin
GbotemiB
GbotemiB
martacki
martacki
LukasFrankenQ
LukasFrankenQ
pz-max
pz-max
davide-f
davide-f
koen-vg
koen-vg
Eddy-JV
Eddy-JV
hazemakhalek
hazemakhalek
energyLS
energyLS
AnasAlgarei
AnasAlgarei
yerbol-akhmetov
yerbol-akhmetov
doneachh
doneachh
danielelerede-oet
danielelerede-oet
DeniseGiub
DeniseGiub
finozzifa
finozzifa
virio-andreyana
virio-andreyana
Tomkourou
Tomkourou
GridGrapher
GridGrapher
drifter089
drifter089
Eric-Nitschke
Eric-Nitschke
glenkiely-ieg
glenkiely-ieg
Emre-Yorat89
Emre-Yorat89
ljansen-iee
ljansen-iee
giacfalk
giacfalk
Ekaterina-Vo
Ekaterina-Vo
lkstrp
lkstrp
TosinGeorge
TosinGeorge
Ly0n
Ly0n
Tooblippe
Tooblippe
arizeosalac
arizeosalac
SermishaNarayana
SermishaNarayana
cpschau
cpschau
gianvicolux
gianvicolux
choiHenry
choiHenry
LucieRC
LucieRC
carlosfv92
carlosfv92
rajesh-ieg
rajesh-ieg
asolavi
asolavi
rsparks3
rsparks3
ollie-bell
ollie-bell
juli-a-ko
juli-a-ko
squoilin
squoilin
siddharth-krishna
siddharth-krishna
pitmonticone
pitmonticone
PierreKara1
PierreKara1
Netotse
Netotse
milyas009
milyas009
kma33
kma33
jessLryan
jessLryan
jarry7
jarry7
HanaElattar
HanaElattar
EmreYorat
EmreYorat
AndreCNF
AndreCNF
AlexanderMeisinger
AlexanderMeisinger