Get and activate your licence

Commercial and free licences

This project is partially open source. The source code of this repository is available under the BSD 3-Clause License.

The solver used in this project is not open source. A license has to be purchased to use it. To obtain a personal or commercial license, please contact us at

For networks with less than 11 buses (up to 10 buses), the license key A8C6DA-9405FB-E74FB9-C71C3C-207661-V3 can be used free of charge. For example, this key can be used to follow the getting started guide.


Licenses are given free of charge for students and teachers. Please contact us at to get a license key.

How to activate the license in your project?

There are two ways to activate the license in your project:

  1. Set the environment variable ROSEAU_LOAD_FLOW_LICENSE_KEY to the license key. When this environment variable is defined, it will automatically be used by the solver to validate the license, no further action is required. This is the recommended approach.


    If you need help setting an environment variable, refer to the section How to set an environment variable?

  2. Call the function activate_license with the license key as argument. This function will activate the license for the current session. If you use this approach, it is recommended to store the license key in a file and read it from there to avoid hard coding it in your code and accidentally committing it to your repository. Example:

    from pathlib import Path
    import roseau.load_flow as rlf
    # Rest of your code here

    where the file my_license_key.txt contains A8C6DA-9405FB-E74FB9-C71C3C-207661-V3 (replace with your license key).

How to set an environment variable?

If you are not sure how to set an environment variable, this article has instructions for Windows, MacOS and Linux. The section Persisting an environment variable explains how to make the environment variable persistent on your machine so that you don’t have to set it every time you open a new terminal.

For Jupyter Notebook users

If you are using a Jupyter Notebook, you can follow these instructions to set the environment variable:

  1. Create a file named .env in the same directory as you notebook with the following content (replace the key with your license key):

  2. Add a cell to the beginning of your notebook with the following content and execute it:

    %pip install python-dotenv
    %load_ext dotenv

    The first line will install the package python-dotenv if it is not already installed. The next lines will load the extension dotenv and load the environment variables from the file .env in the current directory (created in step 1).

For VS Code users

If you are using Visual Studio Code, you can create a file named .env in your project directory (similar to step 1 for Jupyter) and VS Code will automatically load the environment variables from this file when you run your code (including when using Jupyter Notebooks in VS Code).

For PyCharm users

If you are using PyCharm, you can add the environment variable to your Python Console settings as indicated in the screenshot below:

Pycharm Console environment variable