pypsa-eur/doc/installation.rst
2023-03-06 11:45:07 +00:00

4.7 KiB

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Installation

The subsequently described installation steps are demonstrated as shell commands, where the path before the % sign denotes the directory in which the commands following the % should be entered.

Clone the Repository

First of all, clone the PyPSA-Eur repository using the version control system git.

System Message: WARNING/2 (<stdin>, line 20)

Cannot analyze code. Pygments package not found.

.. code:: bash

    /some/other/path % cd /some/path/without/spaces

    /some/path/without/spaces % git clone https://github.com/PyPSA/pypsa-eur.git


Install Python Dependencies

PyPSA-Eur relies on a set of other Python packages to function. We recommend using the package manager and environment management system conda to install them. Install miniconda, which is a mini version of Anaconda that includes only conda and its dependencies or make sure conda is already installed on your system. For instructions for your operating system follow the conda installation guide.

The python package requirements are curated in the envs/environment.yaml file. The environment can be installed and activated using

System Message: WARNING/2 (<stdin>, line 40)

Cannot analyze code. Pygments package not found.

.. code:: bash

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

    .../pypsa-eur % conda activate pypsa-eur


Note that activation is local to the currently open shell! After opening a new terminal window, one needs to reissue the second command!

Note

If you have troubles with a slow conda installation, we recommend to install mamba as a fast drop-in replacement via

System Message: WARNING/2 (<stdin>, line 54)

Cannot analyze code. Pygments package not found.

.. code:: bash

    conda install -c conda-forge mamba

and then install the environment with

System Message: WARNING/2 (<stdin>, line 60)

Cannot analyze code. Pygments package not found.

.. code:: bash

    mamba env create -f envs/environment.yaml

Install a Solver

PyPSA passes the PyPSA-Eur network model to an external solver for performing a total annual system cost minimization with optimal power flow. PyPSA is known to work with the free software

and the non-free, commercial software (for some of which free academic licenses are available)

For installation instructions of these solvers for your operating system, follow the links above. Commercial solvers such as Gurobi and CPLEX currently significantly outperform open-source solvers for large-scale problems. It might be the case that you can only retrieve solutions by using a commercial solver.

System Message: ERROR/3 (<stdin>, line 85)

Unknown directive type "seealso".

.. seealso::
    `Getting a solver in the PyPSA documentation <https://pypsa.readthedocs.io/en/latest/installation.html#getting-a-solver-for-linear-optimisation>`_

Note

The rules :mod:`cluster_network` and :mod:`simplify_network` solve a quadratic optimisation problem for clustering. The open-source solvers Cbc and GlPK cannot handle this. A fallback to Ipopt is implemented in this case, but requires also Ipopt to be installed. For an open-source solver setup install in your conda environment on OSX/Linux

System Message: ERROR/3 (<stdin>, line 89); backlink

Unknown interpreted text role "mod".

System Message: ERROR/3 (<stdin>, line 89); backlink

Unknown interpreted text role "mod".

System Message: WARNING/2 (<stdin>, line 93)

Cannot analyze code. Pygments package not found.

.. code:: bash

    conda activate pypsa-eur
    conda install -c conda-forge ipopt coincbc

and on Windows

System Message: WARNING/2 (<stdin>, line 100)

Cannot analyze code. Pygments package not found.

.. code:: bash

    conda activate pypsa-eur
    conda install -c conda-forge ipopt glpk

or

System Message: WARNING/2 (<stdin>, line 107)

Cannot analyze code. Pygments package not found.

.. code:: bash

    conda activate pypsa-eur
    pip install highspy

Set Up the Default Configuration

PyPSA-Eur has several configuration options that must be specified in a config.yaml file located in the root directory. An example configuration config.default.yaml is maintained in the repository. More details on the configuration options are in :ref:`config`.

System Message: ERROR/3 (<stdin>, line 117); backlink

Unknown interpreted text role "ref".

Before first use, create a config.yaml by copying the example.

System Message: WARNING/2 (<stdin>, line 123)

Cannot analyze code. Pygments package not found.

.. code:: bash

    .../pypsa-eur % cp config.default.yaml config.yaml

Users are advised to regularly check their own config.yaml against changes in the config.default.yaml when pulling a new version from the remote repository.

</html>