Start EnMAP-Box plugin: Python warning shown in QGIS

Issue #698 resolved
suri created an issue

Windows7, QGIS version: 3.16
When starting EnMAP-Box, the python warning will be shown in QGIS

2021-08-18T09:40:59     WARNING    warning:C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py:793: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
              mod = _builtin_import(name, globals, locals, fromlist, level)

             traceback: File "", line 1, in
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 354, in startPlugin
              if not _startPlugin(packageName):
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 334, in _startPlugin
              plugins[packageName] = package.classFactory(iface)
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\__init__.py", line 43, in classFactory
              plugin = EnMAPBoxPlugin(iface)
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\enmapboxplugin.py", line 50, in __init__
              self.initialDependencyCheck()
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\enmapboxplugin.py", line 64, in initialDependencyCheck
              missing = [p for p in requiredPackages() if not p.isInstalled()]
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\dependencycheck.py", line 421, in requiredPackages
              pkg = PIPPackage(pyPkg, cmd)
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\dependencycheck.py", line 118, in __init__
              __import__(self.pyPkgName)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\__init__.py", line 82, in
              from .base import clone
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\base.py", line 17, in
              from .utils import _IS_32BIT
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\__init__.py", line 23, in
              from .class_weight import compute_class_weight, compute_sample_weight
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\class_weight.py", line 7, in
              from .validation import _deprecate_positional_args
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\validation.py", line 26, in
              from .fixes import _object_dtype_isnan, parse_version
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\Users\dell\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\fixes.py", line 28, in
              from pkg_resources import parse_version # type: ignore
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\pkg_resources\__init__.py", line 80, in
              from pkg_resources.extern import appdirs
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 1035, in _handle_fromlist
              File "", line 219, in _call_with_frames_removed
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 668, in _load_unlocked
              File "", line 638, in _load_backward_compatible
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\pkg_resources\extern\__init__.py", line 43, in load_module
              __import__(extant)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\pkg_resources\_vendor\appdirs.py", line 560, in
              import win32com.shell
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 953, in _find_and_load_unlocked
              File "", line 219, in _call_with_frames_removed
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32com\__init__.py", line 6, in
              import pythoncom
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\pythoncom.py", line 2, in
              import pywintypes
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32\lib\pywintypes.py", line 2, in
              import imp, sys, os
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\imp.py", line 33, in
              DeprecationWarning, stacklevel=2)

2021-08-18T09:43:18     WARNING    warning:C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\objcreator.py:152: DeprecationWarning: 'U' mode is deprecated
              plugin = open(filename, 'rU')

             traceback: File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\enmapboxplugin.py", line 99, in run
              self.enmapBox = EnMAPBox(iface)
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\enmapboxgui.py", line 296, in __init__
              self.ui = EnMAPBoxUI()
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\enmapboxgui.py", line 135, in __init__
              loadUi(enmapboxUiPath('enmapbox_gui.ui'), self)
              File "C:/Users/dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\utils.py", line 1079, in loadUi
              return uic.loadUi(buffer, baseinstance=baseinstance, package=package, resource_suffix=resource_suffix)
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\__init__.py", line 226, in loadUi
              return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\Loader\loader.py", line 51, in __init__
              UIParser.__init__(self, QtCore, QtGui, QtWidgets, LoaderCreatorPolicy(package))
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\uiparser.py", line 177, in __init__
              self.factory = QObjectCreator(creatorPolicy)
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\objcreator.py", line 85, in __init__
              if self.load_plugin(filename, plugin_globals, plugin_locals):
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\PyQt5\uic\objcreator.py", line 152, in load_plugin
              plugin = open(filename, 'rU')
              File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\warnings.py", line 99, in _showwarnmsg
              msg.file, msg.line)

Comments (3)

  1. Benjamin Jakimow

    Just a deprecation warning from the qgis.utils imp import

    By the way, your QGIS is outdate

  2. Log in to comment