-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
feature requestNew feature or requestNew feature or request
Description
To ensure that all python packages are loaded right, an updates of the EnMAP-Box plugin requires to restart QGIS.
If this has not been done, errors may occur due to the following problem
- QGIS start
- QGIS load EnMAP-Box version N
import enmapbox.classXYZloads classXYZ- QGIS updates EnMAP-Box version N+1
import enmapbox.classXYZis called, but since it was already loaded before, Python will use the outdated version of classXYZ.- error occurs when using classXYZ with old definition
A solution could be to enforce a reloading of all imports:
# Source - https://stackoverflow.com/a/437591
# Posted by cdleary, modified by community. See post 'Timeline' for change history
# Retrieved 2026-02-02, License - CC BY-SA 4.0
from importlib import reload # Python 3.4+
import foo
while True:
# Do some things.
if is_changed(foo):
foo = reload(foo)but this would required to add an reload for every possible package import. Instead it's probably easier to show a "QGIS restart required" warning if the EnMAP-Box plugin hash (enmapbox.vershion_sha ) has been updated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request