Troubleshooting

During the installation or execution of the model generator, error messages and associated error messages may occur.

Warning

There is a know issue for MacOS users which are using the SESMG as an application which leads to problems opening the application itself. See Error I-009 below to check how to fix it or check the MacOS installation instructions.

Installation

Error I-001: numpy.generic objects

Error Message:

Cannot interpret attribute 'dtype' of 'numpy.generic' objects' as a data type

Possible Error Cause: possible module (e.g., demandlib) not actual

Debugging: upgrade module in the installation.cmd (pip install demandlib –upgrade)

Error I-002: port 443

Error Message:

HTTPSConnectionPool(host='pypi.python.org' port=443), due to a timeout

Possible Error Cause: A package named in the error message was not installed correctly

Debugging: Reinstall the package manually in the virtual environment as follows: 1. open a terminal 2. navigate to your SESMG folder 3. navigate to the scripts-subfolder: cd Scripts 4. start the virtual environment: start /b activate.bat 5. install the missing package as follows: `pip install --default-timeout=100 'PACKAGE-NAME` (see also here)

Error I-003: py not found

Error Message:

py not found

Possible Error Cause: the path variable for the python version you are using was probably not defined

Debugging: Re-install your python-version and make sure to check the “Add pyton to PATH” option at the beginning of the installation

Error I-004: no developer tools installed (macOS > 12.2)

Error Message:

Error: No developer tools installed
Install the Command Line Tools:
   xcode-select --install

Possible Error Cause: If you use macOS 12.2 or higher, you need to install the xcode developer tool. Also if you just updated your macOS to the newer version.

Debugging: Follow the instructions and run xcode-select –install in an additional terminal.

Error I-005: subprocess-exited-with-error

Error Message:

Installation build dependencies ... error
error: subprocess-exited-with-error

pip subprocess to install build dependencies did not run successfully.

Possible Error Cause: maybe the wrong python version was installed. There is a difference between the 32- or 64-bit version.

Debugging: check if you have a 32- or 64-bit machine and if you installed the correct python version. De- and reinstall to correct.

Error I-006: Could not find a local HDF5 installation (macOS M1/M2)

Error Message:

 * USE_PKGCONFIG: True
.. ERROR:: Could not find a local HDF5 installation.
   You may need to explicitly state where your local HDF5 headers and
   library can be found by setting the ``HDF5_DIR`` environment
   variable or by using the ``--hdf5`` command-line option.

Possible Error Cause: The packages were installed to an unexpected path by homebrew, which is an Apple CPU M1 / M2 issue.

Debugging: Type following lines separately in the terminal: (echo; echo 'export HDF5_DIR=/opt/homebrew/opt/hdf5') >> /Users/$(whoami)/.zprofile and (echo; echo 'export BLOSC_DIR=/opt/homebrew/opt/c-blosc') >> /Users/$(whoami)/.zprofile.

Error I-007: No module named streamlit I

Error Message:

No module named streamlit

Possible Error Cause I: This issue can occur at the first model run after installation, even if there was no error message. Maybe you typed in the wrong python version at the installation.

Debugging I: You need to delete the folder and restart the installation with a ‘freshly’ unpacked .zip file (downloadable on Github). Make sure to type your installed python version in the major.minor format, which means to give 3.X if you have the version 3.X.YY.

Possible Error Cause II: The SESMG is compatible with a specific set of Python versions. The problem can occur if you are using an unsupported version. You can find a list of the supported Python versions in the installation instructions.

Debugging II: You can install an additional Python version on your machine which is facing the SESMGs requirements. Afterwards you need to restart the installation process from scratch in a new folder.

Error I-008: No module named streamlit II

Error Message:

\user\..\.streamlit is already existing
...
Error: No matching distribution found for streamlit>=1.17.0

Possible Error Cause: The SESMG, or especially the subpackage streamlit, is not compatible with the python version 3.9.7.

Debugging: Check if you have this version. If so, you need to install another version or update the version.

Error I-009: The application does not start after double-clicking (MacOS)

Possible Error Cause I: Due to a bug in a subpackage it is not possible yet to open the SESMG as common by double-clicking it on MacOS.

Debugging I: You need to use the terminal to open the application. Navigate to the directory by using the command inputs (e. g. cd) or right-click the folder in which the application is placed (e. g. “desktop”) and choose “new terminal at the folder”. Type in the command open SESMG.app.

Possible Error Cause II: Due to a bug in a subpackage the SESMG does not kill all processes after closing the application on MacOS.

Debugging II: To kill all processes you need to use your taskmanager and stop the “SESMG”-processes manually. Make sure to kill it after each session. Otherwise you will not be able to reopen it by using the way described above. We are working on it!

Error I-010: Encountered error while trying to install future

Possible Error Cause: Future package cannot be installed because pip is not upgraded. Debugging: Upgrade pip with: “py -3.X -m pip install –upgrade pip”. Change 3.X to your python version.

Modeling

General debugging

Pay attention to the correct spelling:

  • Pay attention to correct upper and lower case.

  • Do not use spaces in the entire spreadsheet (except for the “comment” columns).

  • Make sure that every column of the used lines is filled. Columns that are not used can be filled with a “0”.

Make sure that the displayed system can stay in balance. - It must always be possible to take off all of the supplied energy and vice versa. - The use of excess-sinks and shortage-sources can help to keep the system in balance.

Your error message is not included? Help us and all users by reporting your error message - with or without a solution!. Thank you!

Error M-001: KeyError sequences (sources)

Error Message:

flowsum = source['sequences'].sum() KeyError: 'sequences'

Possible Error Cause: A system component was entered incorrectly in the input file.

Debugging: For all components make sure that 1) each column is filled correctly and 2) the first component of a sheet is entered in the row directly below the header row and that there are no blank rows between the individual components of a sheet

Error M-002: solver did not exit normally I

Error Message:

ApplicationError: Solver (cbc) did not exit normally

Possible Error Cause: A system component was entered incorrectly in the input file.

Debugging: For all components make sure that 1) each column is filled correctly and 2) the first component of a sheet is entered in the row directly below the header row and that there are no blank rows between the individual components of a sheet

Error M-003: KeyError sequences (results)

Error Message:

df = node_results['sequences'] KeyError: 'sequences'

Possible Error Cause: The implemented model probably has an circuit. For example the excess sink of a bus could achieve higher selling prices than buying from a shortage source. In theory this could generate an infinitely large profit. Such a model cannot be solved.

Debugging: Make sure there are no circuits within the model.

Error M-004: Memory Error

Error Message:

Memory Error

Possible Error Cause: The available memory is not sufficient to solve the model.

Debugging: Take the following measures gradually until the error no longer occurs: (1) Restart the used Python interpreter (2) Close unnecessary programs on the computer (3) Make sure that python 64 bit version is used (Python 32 bit can manage only 2 GB of memory). (4) Start the program on a computer with a higher memory.

Error M-005: time module

Error Message:

AttributeError: module 'time' has no attribute 'clock'

Possible Error Cause: You are using a Python version not compatible with oemof.

Debugging: Use Python 3.7.6

Error M-006: shapes

Error Message:

ValueError: operands could not be broadcast together with shapes (8784 ) (8760 )

Possible Error Cause: The weather dataset contains the wrong number of data points for using feedinlib.

Debugging: Make sure that the number of weather data points corresponds to the time steps of the model (At hourly resolution one year has 8760 time steps). When simulating a leap year it is recommended limiting the time horizon to 8760 hours.

Error M-007: solver did not exit normally II

Error Message:

ValueError: pyutilib.common._exceptions.ApplicationError: Solver (cbc) did not exit normally

Possible Error Cause: “A value for the use of the investment module (e.g. “min Investment Capacity”) was not filled in.”

Debugging: Make sure that all necessary cells of the spreadsheet have been filled in.

Error M-008: KeyError component

Error Message:

KeyError: '__any component name__'

Possible Error Cause: Incorrectly assigned bus name for the input or output of a component

Debugging: Check that all bus references are correct. Also check for typos.

Error M-009: Type Error

Error Message:

TypeError: ufunc 'true_divide' not supported for the input types  and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Possible Error Cause: “The column “”annual demand”” was not filled in correctly for a sink.”

Debugging: Make sure to use the “”annual demand”” column for SLP and Richardson sinks and the “”nominal value”” column for time series sinks.

Error M-010: Variable Type Attribute

Error Message:

AttributeError: 'str' object has no attribute 'is_variable_type'

Possible Error Cause: The cost value for an activated excess sink or shortage source was not correctly specified in the bus sheet

Debugging: Make sure that all excess/shortage prices consist of real numbers. Also check for typos.

Error M-011: Investment Flow

Error Message:

Implicitly replacing the Component attribute equate_InvestmentFlow.invest[districtheat_undirected_link districtheat_bus]_InvestmentFlow.invest[ districtheat_undirected_link heat_bus] (type=<class 'pyomo.core.base.constraint.SimpleConstraint'>) on block Model with a new Component (type=<class 'pyomo.core.base.constraint.AbstractSimpleConstraint'>). This is usually indicative of a modelling error. To avoid this warning  use block.del_component() and block.add_component().

Possible Error Cause: This is no user error because this error is due to the way undirected links are implemented

Debugging: No action needed, the modeling process is not effected.

Error M-012: Key Error (Index)

Error Message (example):

KeyError: 'Index \'(''<oemof.solph.network.source.Source: \'ID_photovoltaic_electricity_source\'>' ''<oemof.solph.network.bus.Bus: \'ID_pv_bus\'>'' 0)\' is not valid for indexed component \'flow\''

Possible Error Cause I: You probably named the busses incorrectly.

Debugging I: Check if all busses are named correctly.

Possible Error Cause II: If you added a wind turbine, it is possible that the windpowerlib has not all information about the chosen turbine model.

Debugging II: Deactivate the wind turbine to validate the error. Choose another turbine model (which has model and power curve data), to solve the issue.

Error M-013: Key error (source)

Error Message (example):

KeyError: 'ID_photovoltaik_electricity_source'

Possible Error Cause: In this case - PV sources were deactivated although they were still addressed in the area competition

Debugging: Make sure that if you have disabled pv sources - you do the same for the competition constraint.

Error M-014: User Warning Condition Infeasible

Error Message:

UserWarning: Optimization ended with status warning and termination condition infeasible

Possible Error Cause: the model is not solvable - probably because not enough energy is inserted to satisfy the energy demand

Debugging: make sure that the sources are able to insert enough energy to the system

Error M-015: Flow NaN-Values

Error Message:

Flow: ID_electricity_to_ID_hp_electricity_bus-ID_electricity_bus. This could be caused by NaN-values in your input data.

Possible Error Cause: You have probably used not allowed special characters (e.g. m³)

Debugging: Make sure you have not used any special characters (e.g., use m3 instead of m³)

Error M-016: Dyn Function H0

Error Message:

FutureWarning: Current default for 'dyn_function_h0' is 'False'. This is about to change to 'True'. Set 'False' explicitly to retain the current behaviour.

Possible Error Cause: the wrong version of the feedinlib is used

Debugging: make sure you are using feedinlib==0.0.12

Error M-017: Create Flow Data Frames

Error Message:

in create_flow_dataframes for index; value in component['sequences'].sum().items(): KeyError: 'sequences',

Possible Error Cause: You have probably entered an invalid “transformer type” within the transformers sheet

Debugging: check and correct the transformer types entered to the sheet

Error M-018: Assertion Error

Error Message:

... AssertionError: Time discretization of irradiance is different from timestep 3600seconds. You need to change the resolution; first!

Possible Error Cause: For the application of the richardson tool a weather dataset of a full year is required

Debugging: Add a full year weather data set to the weather data sheet.

Error M-019: Duplicates

Error Message:

Possible duplicate uids/labels?

Possible Error Cause: two components of the model are having the same name

Debugging: rename at least one of the components

Error M-020: Value Error Length Mismatch

Error Message:

ValueError: Length mismatch: Expected axis has 1 elements; new values have 8760 elements Flow: ID_pv_to_ID_electricity_link-ID_pv_bus. This could be caused by NaN-values in your input data.

Possible Error Cause: The model probably isn’t solvable, because of wrong energy balance.

Debugging: Activate necessary excesses sinks and shortages sources.

Error M-021: Solver Returned Non-Zero Return Code

Error Message:

ERROR: Solver (gurobi) returned non-zero return code (1)

Possible Error Cause:

Debugging: reinstall the pyomo-package: 1. open a terminal 2. navigate to your SESMG folder 3. navigate to the scripts-subfolder: “cd Scripts” 4. start the virtual environment: start /b activate.bat 5. reinstall pyomo: pip install pyomo==5.7.1

Error M-022: Key Error (sequences) II

Error Message:

df = node_results['sequences'] KeyError: 'sequences'

Possible Error Cause: The model may possibly have an over or under supply. This will break the calculation.

Debugging: The bus of the oversupply or undersupply can be localized by activating excess or shortage.

Error M-023: nearest foot point

Error Message:

... get nearest_perp_foot_point foot_point.extend(foot_points[0])
IndexError: list index out of range

Possible Error Cause: The producer could not be connected to the defined heat network. This is probably due to the fact that a right-angled connection to the producer is not possible to the defined pipes. Debugging: Make sure that the producers can be connected to the heat network with a right angle. It is possible that the producer is too far away from the network. Make sure that you deactivate the district heating connection in each bus, when you dont use a heat network.

Error M-024: KeyError: ‘lon’

Error Message:

... in get_loc
raise KeyError(key) from err
KeyError: 'lon'

Possible Error Cause: No heat source bus has been correctly defined for the heat network.

Debugging: make sure the heat source bus has been defined correctly, especially the columns “district heating conn.”, “lat”, and “lon”.

Error M-025: “left_on” OR “left_index”

Error Message:

... pandas.errors.MergeError: Can only pass argument "left_on" OR "left_index" not both.

Possible Error Cause: You are using an incompatible version of the pandas-package.

Debugging: Install pandas version 1.0.0 in the virtual environment used for the SESMG

Error M-026: Key Error (sequences) III

Error Message:

... in get_sequence return_list.append([component["sequences"][(i, "flow")]])

Possible Error Cause I: No power supply is provided. The error can occur if only one air source heat pump is considered for the heat supply and the outdoor air temperature is higher than the flow temperature of the heating system.

Debugging I: Using a higher flow temperature or a lower outdoor air temperature, consider an alternative technology

Possible Error Cause II: There are storages with a missing initial capacity.

Debugging II: Make sure the initial capacity is equal or higher than the minimal capacity.

Error M-027: Key Error (Index) II

Error Message:

KeyError: 'Index \'("<oemof.solph.network.source.Source: \'insulation-..._roof\'>", "<oemof.solph.network.bus.Bus: \'..._heat_bus\'>", 0)\' is not valid for indexed component \'flow\''

Possible Error Cause: The u-value of your building component meets the requirements.

Debugging: Do not consider insulation measurements for the building component.

Error M-028: invalid literal for int()

Error Message:

ValueError: invalid literal for int() with base10: 'none'

Possible Error Cause: Wrong parameters for the timeseries preparation have been selected.

Debugging: Make sure, that you have defined the parameters for the timeseries preparation correctly. Try changing the values for ‘Period’ and ‘Season’ to other values than ‘none’.

Error M-029: KeyError (variable)

Error Message:

KeyError: '*variable*'
...
raise KeyError(key) from err

Possible Error Cause: There could be a a missing value in the model definition. Check the column with the name of the ‘variable’. The ‘variable’can have several values / names.

Debugging: Make sure, that you have filled out the column and that the values are correct. Use the actual version of the model definition spreadsheet.

Error M-030: KeyError (Sector)

Error Message:

KeyError: '*Sector*'
...
raise KeyError(key) from err

Possible Error Cause: You did not label the sinks in the sector column correct.

Debugging: Label the sinks according to their sector of use like ‘electricity’ or ‘heat’.

Error M-031: Existing capacity for non-convex investment decision

Error Message:

AttributeError: Values for 'offset' and 'existing' are given in investment attributes.
 These two options cannot be considered at the same time.

Possible Error Cause: When non-convex investment decisions are selected, no existing capacities are allowed.

Debugging: Make sure no existing-capacities are given for components including non-convex decisions. If an existing capacity is required an additional component can be used for considering this capacity.

Error M-032: Key Error (column)

Error Message:

KeyError: '*column name*'

Possible Error Cause: When using older model definition sheets in newer versions of the SESMG, certain columns might be missing or incomplete. For example, if the column ‘timezone’ doesn’t exist or remains empty, the stated error will occur.

Debugging: Fill in the missing content to the corresponding column or add the column as it appears in the up-to-date model definition example.

Warning W-001: Need to install … / Cartopy …

Warning Message:

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8502
Network URL: http://xxx.xxxx.x.xxx:8502

Need to install osmnx to download from osm.
INFO:root:Cartopy is not installed. Background maps will not be drawn.

Possible Error Cause: No error occurs.

Debugging: You do not need to add any packages. The process will work perfectly without those packages, which where required by a submodule but not used by the SESMG. We skip the installation of those packages, to keep the installation as small as possible.

Error M-032: Key Error (column)

Error Message:

KeyError: '*column name*'

Possible Error Cause: When using older model definition sheets in newer versions of the SESMG, certain columns might be missing or incomplete. For example, if the column ‘timezone’ doesn’t exist or remains empty, the stated error will occur.

Debugging: Fill in the missing content to the corresponding column or add the column as it appears in the up-to-date model definition example.

Warning W-001: Need to install … / Cartopy …

Warning Message:

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8502
Network URL: http://xxx.xxxx.x.xxx:8502

Need to install osmnx to download from osm.
INFO:root:Cartopy is not installed. Background maps will not be drawn.

Possible Error Cause: No error occurs.

Debugging: You do not need to add any packages. The process will work perfectly without those packages, which where required by a submodule but not used by the SESMG. We skip the installation of those packages, to keep the installation as small as possible.

Contributing to the troubleshooting

Were you able to solve a bug that was not listed here yet? Help other users and report it by following these simple steps:

  1. Open https://github.com/SESMG/SESMG/blob/master/docs/03.00.00_trouble_shooting.rst

  2. Click on the pencil icon in the upper right corner to edit the file.

  1. Find the “Installation”, or “Modeling” section, depending on what type of error you want to add.

  2. Copy the following text block to the end of the respective section and modify the text to describe your error:

Error M-XXX: Error-Name

Error Message:

error message line 1
error message line 2

Possible Error Cause: explain the error cause

Debugging: explain how to solve the error

  1. Click “Create pull request”

  2. Name your pull request and click “create pull request”.

  3. That’s it, thanks for your contribution!