Skip to content

An error has occurred while executing Python code - GQF #566

@biglimp

Description

@biglimp

Discussed in #565

Originally posted by 030Skript October 30, 2023
Hello all,

I wanted to use the GQF module for my master thesis. While trying to start the tutorial, I encountered the following problem on 2 different computers (Windows 10). After installing UMEP (4.0.2) for QGIS (3.34) and downloading the following packages, I prepared the data sources and clicked on "Prepare input data via data sources" and after a few seconds I got:

An error has occurred while executing Python code

IndexError: list index out of range 
Traceback (most recent call last):
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\greater_qf.py", line 192, in disaggregate
    processed = self.model.processInputData()
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\GreaterQF.py", line 105, in processInputData
    processedPath = disaggregate(
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\Disaggregate.py", line 72, in disaggregate
    bldgEnergy.setIndustrialElec(ie['shapefile'],
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\EnergyUseData.py", line 76, in setIndustrialElec
    return self.indElec.addInput(input, startTime, attributeToUse, inputFieldId, weight_by=weight_by, epsgCode=epsgCode)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 448, in addInput
    return self.dealWithVectorLayer(input, epsgCode, startTime, attributeToUse, weight_by, inputFieldId)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 168, in dealWithVectorLayer
    resampled = self.resampleLayer(vectorLayer, attributeToUse, weight_by, inputIdField)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 325, in resampleLayer
    if sameFeatures(inputLayer, self.outputLayer):
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\spatialHelpers.py", line 913, in sameFeatures
    infeat = layer1.selectedFeatures()[0]
IndexError: list index out of range

version info:

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS-Version: 3.34.0-Prizren Prizren, ffbdd67881 

Python-Pfad:
C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SUEWSPrepare/Modules
C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep
C:/OSGeo4W/apps/qgis/./python
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\apps\grass\grass83\etc\python
C:\Users\User\Documents
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\Users\User\AppData\Roaming\Python\Python39\site-packages
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python

So, now that I've tried it on my PC and have the same problem, I hope you guys have a solution to this issue? After pressing the button once, I can no longer use it and have to restart QGIS.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions