qgis-earthengine-plugin: couldn't activate the plugin

Hi, I just installed the plugin but when I wanted to activate it, I faced this error:

Couldn't load plugin 'ee_plugin' due to an error when calling its classFactory() method 

TypeError: get_authorization_url() missing 1 required positional argument: 'code_challenge' 
Traceback (most recent call last):
  File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 230, in get_persistent_credentials
    tokens = json.load(open(oauth.get_credentials_path()))
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\javad/.config/earthengine/credentials'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 19, in init
    ee.Initialize()
  File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\__init__.py", line 114, in Initialize
    credentials = data.get_persistent_credentials()
  File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 241, in get_persistent_credentials
    'Please authorize access to your Earth Engine account by '
ee.ee_exception.EEException: Please authorize access to your Earth Engine account by running

earthengine authenticate

in your command line, and then retry.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.12/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\__init__.py", line 25, in classFactory
    from .ee_plugin import GoogleEarthEnginePlugin
  File "C:/PROGRA~1/QGIS3~1.12/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_plugin.py", line 26, in 
    ee_plugin.ee_auth.init()
  File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 21, in init
    authenticate()
  File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 32, in authenticate
    auth_url = ee.oauth.get_authorization_url()
TypeError: get_authorization_url() missing 1 required positional argument: 'code_challenge'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.12.0-București București, cd141490ec 

Python Path:
C:/PROGRA~1/QGIS3~1.12/apps/qgis/./python
C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.12/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.12\apps\Python37
C:\PROGRA~1\QGIS3~1.12\apps\Python37\Scripts
C:\PROGRA~1\QGIS3~1.12\bin\python37.zip
C:\PROGRA~1\QGIS3~1.12\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib
C:\PROGRA~1\QGIS3~1.12\bin
C:\Users\javad\AppData\Roaming\Python\Python37\site-packages
C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages\Pythonwin
C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web
C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing
C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing
C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs
.
D:/javad/Documents/Work/hydrotech toos/QuickOSM-municipality
C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18

Commits related to this issue

Most upvoted comments

are you through a proxy? In your scripts, configure proxy settings on top of them:

import os
os.environ['HTTP_PROXY'] = 'http://[username:password@]<ip_address_or_domain>:<port>'
os.environ['HTTPS_PROXY'] = 'http://[username:password@]<ip_address_or_domain>:<port>'

import ee
from ee_plugin import Map

check the FAQ https://github.com/gee-community/qgis-earthengine-plugin#faq

@M-Rezvanpour yes now, could you please test with this zip (I couldn’t reproduce it then I’m not sure if with this changes fix the problem): https://drive.google.com/file/d/1x8QCQ-5CzjQEk-cNEyMU87Xz5S8LaR7s/view?usp=sharing

Thanks, I’ll review it, please keep tuned

Hi, this error was fixed in #62 (but not released yet), use the zip attached in this comment https://github.com/gee-community/qgis-earthengine-plugin/issues/62#issuecomment-665224009