Welcome to the PyPSA workshop#

Hosted by TransnetBW, January 2025

Google Colab#

You can work with the workshop materials without a local Python installation using online service Google Colab which provides an online Python environment. This requires a Google account.

Open any jupyter notebook and click on the rocket 🚀 in the top right corner. It will launch a Colab workspace in your browser with the jupyter notebook loaded.

If that does not work download the .ipynb file and import it in Google Colab

Setting up your Python environment locally#

Anaconda#

Coordinating the compatibility between different Python software packages and their multiple versions can be difficult! Fortunately, the problem is solved by using a Python distribution and/or package manager.

For instance, you can install on your computer the popular Anaconda Python Distribution.

For Linux and MacOS users, you can access the command line by opening the terminal program.

For Windows users, you should first install Anaconda (described above) or miniconda (described below), which gives you access to the “Anaconda Prompt” desktop application. Instructions for this are given on the Anaconda Website. From the Anaconda Prompt, you should be able to run conda.

Managing environments with conda#

Python coupled with a package manager provides a way to make isolated, reproducible environments where you have control over all installed packages and configurations.

Here is a great short article that contains all the essential concepts and tips about using conda.

Tip: use lightweight miniconda#

Do yourself a favor — use a lightweight installation called miniconda. It is very likely that you don’t want the full Anaconda Python Distribution.

Environment for this course: workshop#

… with pip#

If you want to use pip for managing your environment, download

Irieo/workshop-pypsa-transnetbw

There is a download button at the top-right corner.

After navigating to the folder where the requirements.txt file is stored, you can install the required packages with

pip install -r requirements.txt

This should allow you to start a new Jupyter window:

jupyter lab

Acknowledgements#

We acknowledge support from the German Federal Ministry for Economic Affairs and Climate Action (BMWK) under Grant No. 03EI4083A (RESILIENT) jointly with the CETPartnership through the Joint Call 2022.

More about the RESILIENT project: https://resilient-project.github.io/