gee-community / qgis-earthengine-plugin

Integrates Google Earth Engine and QGIS using Python API
http://qgis-ee-plugin.appspot.com
MIT License
454 stars 116 forks source link

ee/data.py:230: ResourceWarning and __init__.py:45: DeprecationWarning #106

Closed aloboa closed 2 years ago

aloboa commented 2 years ago

As soon as I start QGIS, I get: 2022-01-20T08:59:10 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/data.py:230: ResourceWarning:

         unclosed file 

         traceback: File "", line 1, in 
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 443, in startPlugin
          if not _startPlugin(packageName):
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 423, in _startPlugin
          plugins[packageName] = package.classFactory(iface)
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/__init__.py", line 33, in classFactory
          from .qgis_gee_data_catalog import GeeDataCatalog
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 32, in __wrapping_ee_import__
          _module_ = __builtin_import__(name, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1007, in _find_and_load
          File "", line 986, in _find_and_load_unlocked
          File "", line 680, in _load_unlocked
          File "", line 855, in exec_module
          File "", line 228, in _call_with_frames_removed
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/qgis_gee_data_catalog.py", line 26, in 
          from .ee_interface import (add_ee_image_layer, download_ee_image_layer,
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 32, in __wrapping_ee_import__
          _module_ = __builtin_import__(name, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1007, in _find_and_load
          File "", line 986, in _find_and_load_unlocked
          File "", line 680, in _load_unlocked
          File "", line 855, in exec_module
          File "", line 228, in _call_with_frames_removed
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/ee_interface.py", line 6, in 
          import ee
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 36, in __wrapping_ee_import__
          _module_.Initialize()
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/__init__.py", line 114, in Initialize
          credentials = data.get_persistent_credentials()
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/data.py", line 230, in get_persistent_credentials
          tokens = json.load(open(oauth.get_credentials_path()))
          File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
          sw(msg.message, msg.category, msg.filename, msg.lineno,

2022-01-20T08:59:10 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/httplib2shim/init.py:45: DeprecationWarning:

         Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

         traceback: File "", line 1, in 
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 443, in startPlugin
          if not _startPlugin(packageName):
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 423, in _startPlugin
          plugins[packageName] = package.classFactory(iface)
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/__init__.py", line 33, in classFactory
          from .qgis_gee_data_catalog import GeeDataCatalog
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 32, in __wrapping_ee_import__
          _module_ = __builtin_import__(name, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1007, in _find_and_load
          File "", line 986, in _find_and_load_unlocked
          File "", line 680, in _load_unlocked
          File "", line 855, in exec_module
          File "", line 228, in _call_with_frames_removed
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/qgis_gee_data_catalog.py", line 26, in 
          from .ee_interface import (add_ee_image_layer, download_ee_image_layer,
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 32, in __wrapping_ee_import__
          _module_ = __builtin_import__(name, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1007, in _find_and_load
          File "", line 986, in _find_and_load_unlocked
          File "", line 680, in _load_unlocked
          File "", line 855, in exec_module
          File "", line 228, in _call_with_frames_removed
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_gee_data_catalog/ee_interface.py", line 6, in 
          import ee
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 36, in __wrapping_ee_import__
          _module_.Initialize()
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/__init__.py", line 115, in Initialize
          data.initialize(
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/data.py", line 210, in initialize
          _install_cloud_api_resource()
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/data.py", line 280, in _install_cloud_api_resource
          _cloud_api_resource = _cloud_api_utils.build_cloud_resource(
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/ee/_cloud_api_utils.py", line 133, in build_cloud_resource
          http_transport = httplib2.Http(timeout=timeout)
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/httplib2shim/__init__.py", line 117, in __init__
          pool = self._make_pool(proxy_info=proxy_info)
          File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux/httplib2shim/__init__.py", line 45, in _default_make_pool
          if isinstance(proxy_info, collections.Callable):
          File "/usr/lib/python3.9/collections/__init__.py", line 62, in __getattr__
          warnings.warn("Using or importing the ABCs from 'collections' instead "
          File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
          sw(msg.message, msg.category, msg.filename, msg.lineno,
gena commented 2 years ago

This sounds like a qgis_gee_data_catalog plugin issue, can you try to uninstall that and see if the warning keeps coming, if not - please report it on the qgis_gee_data_catalog github