Installation and setup

This page gives guidelines for installing ExerPy on Linux and Windows. ExerPy is a Python package, so it requires you to have Python 3 installed.

Installation of ExerPy

Installing Python 3

Most Linux distributions provide Python 3 in their repositories. On Ubuntu or Debian, install it together with its venv module by running:

sudo apt-get install python3 python3-venv

Other versions of Python are available from https://www.python.org/downloads/.

Installing ExerPy in a virtual environment

We recommend installing ExerPy in a virtual environment rather than in the system-wide Python installation. The venv module of Python creates one.

  1. Open a terminal in your project folder, then create and activate a virtual environment named .venv:

    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Update pip:

    python -m pip install --upgrade pip
    
  3. Install ExerPy with the extras you need:

    • with JSON input only

      pip install exerpy
      
    • with TESPy models

      pip install exerpy[tespy]
      
    • with cost estimates from the correlations of OpenPyTEA

      pip install exerpy[costs]
      
    • with Sankey and waterfall diagrams

      pip install exerpy[viz]
      

    Several extras can be combined, for example pip install exerpy[tespy,costs].

Installing Python 3

Download and install Python 3 from https://www.python.org/downloads/.

Installing ExerPy in a virtual environment

We recommend installing ExerPy in a virtual environment rather than in the system-wide Python installation. The venv module of Python creates one.

  1. Open a command prompt in your project folder, then create and activate a virtual environment named .venv:

    py -m venv .venv
    .venv\Scripts\activate
    
  2. Update pip:

    python -m pip install --upgrade pip
    
  3. Install ExerPy with the extras you need:

    • with JSON input only

      pip install exerpy
      
    • with TESPy models

      pip install exerpy[tespy]
      
    • with Ebsilon Professional models

      pip install exerpy[ebsilon]
      
    • with Aspen Plus models

      pip install exerpy[aspen]
      
    • with cost estimates from the correlations of OpenPyTEA

      pip install exerpy[costs]
      
    • with Sankey and waterfall diagrams

      pip install exerpy[viz]
      

    Several extras can be combined, for example pip install exerpy[tespy,costs].

Using conda

Conda environments work as well. In a conda prompt, create and activate one, then install ExerPy with pip as in step 3:

conda create -n exerpy python=3.12
conda activate exerpy

If you would like access to features that are not yet released or still under development, you can install the developer version. The steps are similar to the ones above, but INSTEAD of installing ExerPy using

pip install exerpy

follow the instructions on this page.

Additional Setup for Ebsilon Users

To enable ExerPy to access the Ebsilon Python program files, you need to set an environment variable named EBS with the path to your Ebsilon Python directory. This allows ExerPy to locate and import the necessary Ebsilon modules. This is what you need to do if you are using Windows 11:

  1. Search for and click on Edit the system environment variables.

  2. Click on Advanced.

  3. Click on Environment Variables.

  4. Under User variables, click New.

  5. Set the variable name to EBS and the variable value to the path of your Ebsilon Python files, for example: C:\Program Files\Ebsilon\EBSILONProfessional 17\Data\Python

Be sure to replace the path with the actual location of your Ebsilon Python directory. After setting the environment variable, restart your terminal or IDE to ensure the changes take effect.

Additional Setup for Aspen Plus Users

Aspen Plus does not calculate physical exergy by default. Instead, you must define it as a user property in each model. To do so, select the Calculation Options tab in the Setup folder in the Simulation menu on the left. In the Calculations tab, you will see two fields titled Exergy reference environment temperature and Exergy reference environment pressure. Enter the desired values for the exergy analysis.

Then, select Property Sets from the Simulation menu on the left. In the Properties tab, click the Search button. Search for the EXERGYMS entry and add it. In the Units column next to the Physical Properties column, set J/kg as the unit.

Next, select the Report Options tab from the Setup folder in the Simulation menu on the left. Select the Stream tab on the right and click the Property Sets button. Move EXERGYMS from Available property sets to Selected property sets and confirm. Afterwards, run the simulation and save it.

The split of the physical exergy into its thermal and mechanical parts (split_physical_exergy=True) needs no further setup. ExerPy adds a property analysis for each stream to the model in memory and runs the simulation once while it reads the model. The model file stays unchanged.