Closed M-Rezvanpour closed 4 years ago
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
Thanks, problem solved but now every time when I want to run a script, a new earth engine authentication window opens in my browser to allow the earth engine. After I clicking on the allow button, a code shows but I don't know where to put it in the plugin (it's something like the API code)
If the plugin ask about the earth engine auth if because you haven't completed the authentication process for the plugin, copy the earth engine code in the window that plugin open for it
for instance, the code below:
import ee
from ee_plugin import Map
# traditional python string
print('Hello world!')
# Earth Eninge object
print(ee.String('Hello World from Earth Engine!').getInfo())
print(ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318').getInfo())
how can I complete the authentication process? should I dot it in the code or can I do it through the plugin? because I didn't see any config option for this in the plugin's options
When you run it that code, the plugin should open a dialog like this, copy in that entry the auth access code
this dialog doesn't show up!
sure? it should open a dialog, else it is a bug
yeah, I'm using QGIS version 3.12.0 and I just installed the plugin using the zip file you said earlier
but the web page to authorization opens automatically? can you see any error in Qgis? please restart Qgis and try again
yes, web page opens here's the error:
Google Earth Engine Authorization:
If the web browser does not start automatically, start it manually and open the following URL:
"https://accounts.google.com/o/oauth2/auth?client_id=517222506229-vsmmajv00ul0bs7p89v5m89qs8eb9359.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fearthengine+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&code_challenge=XbWOxJmulfNiwGmrxL8AlMvvsNqn8cz0xIYk2f13jsQ&code_challenge_method=S256"
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 21, 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\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "<string>", line 2, in <module>
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\Map.py", line 15, in <module>
ee_plugin.ee_auth.init()
File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 23, in init
if authenticate():
File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 54, in authenticate
'URL: ' + tiny_url(auth_url))
File "C:/Users/javad/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_auth.py", line 31, in tiny_url
tinyurl = urllib.request.urlopen(apiurl + url).read()
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
tried that, but nothing changed!
could you please confirm this restarting Qgis and try again?
I did that but same problem happened!
Thanks, I'll review it, please keep tuned
@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
@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, the dialog box now shows up! but after that I got this error:
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "<string>", line 2, in <module>
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\Map.py", line 15, in <module>
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
ee.Initialize()
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\__init__.py", line 123, in Initialize
http_transport=http_transport)
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 210, in initialize
_install_cloud_api_resource()
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 287, in _install_cloud_api_resource
http_transport=_http_transport)
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\_cloud_api_utils.py", line 149, in build_cloud_resource
model=alt_model)
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\discovery.py", line 264, in build
raise e
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\discovery.py", line 246, in build
requested_url, discovery_http, cache_discovery, cache, developerKey
File "C:\Users\javad\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\discovery.py", line 308, in _retrieve_discovery_doc
raise HttpError(resp, content, uri=actual_url)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://earthengine.googleapis.com/$discovery/rest?version=v1alpha&prettyPrint=false returned "Forbidden">
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
I'm going to close this, feel free to open it again if the bug persists
Hi, I'm using QGIS version 3.14.16, this error occurred when I installed the Google Earth Engine plugin and tried to load the map.
Hi, I just installed the plugin but when I wanted to activate it, I faced this error: