Replies: 2 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
giswqs
-
Did you sign up for an Earth Engine account? Are you using a VPN to access Google services? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I just installed geemap, but I meet a long error when run the code in Jupyter, I dont know how to fix this.
FileNotFoundError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\ee\data.py in get_persistent_credentials()
218 try:
--> 219 tokens = json.load(open(oauth.get_credentials_path()))
220 refresh_token = tokens['refresh_token']
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Administrator/.config/earthengine/credentials'
During handling of the above exception, another exception occurred:
EEException Traceback (most recent call last)
~\Anaconda3\lib\site-packages\geemap\common.py in ee_initialize(token_name)
81
---> 82 ee.Initialize()
83 except Exception:
~\Anaconda3\lib\site-packages\ee_init_.py in Initialize(credentials, opt_url, cloud_api_key, http_transport, project)
114 if credentials == 'persistent':
--> 115 credentials = data.get_persistent_credentials()
116 data.initialize(
~\Anaconda3\lib\site-packages\ee\data.py in get_persistent_credentials()
229 raise ee_exception.EEException(
--> 230 'Please authorize access to your Earth Engine account by '
231 'running\n\nearthengine authenticate\n\nin your command line, and then '
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:
HTTPError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\ee\oauth.py in request_token(auth_code, code_verifier)
85 TOKEN_URI,
---> 86 parse.urlencode(request_args).encode()).read().decode()
87 refresh_token = json.loads(response)['refresh_token']
~\Anaconda3\lib\urllib\request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 opener = _opener
--> 222 return opener.open(url, data, timeout)
223
~\Anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout)
530 meth = getattr(processor, meth_name)
--> 531 response = meth(req, response)
532
~\Anaconda3\lib\urllib\request.py in http_response(self, request, response)
640 response = self.parent.error(
--> 641 'http', request, response, code, msg, hdrs)
642
~\Anaconda3\lib\urllib\request.py in error(self, proto, *args)
568 args = (dict, 'default', 'http_error_default') + orig_args
--> 569 return self._call_chain(*args)
570
~\Anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
502 func = getattr(handler, meth_name)
--> 503 result = func(*args)
504 if result is not None:
~\Anaconda3\lib\urllib\request.py in http_error_default(self, req, fp, code, msg, hdrs)
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
HTTPError: HTTP Error 404: Not Found
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
in ()
----> 1 Map = geemap.Map(center=[40,-100], zoom=4)
~\Anaconda3\lib\site-packages\geemap\geemap.py in init(self, **kwargs)
35
36 if kwargs["ee_initialize"]:
---> 37 ee_initialize()
38
39 # Default map center location (lat, lon) and zoom level
~\Anaconda3\lib\site-packages\geemap\common.py in ee_initialize(token_name)
82 ee.Initialize()
83 except Exception:
---> 84 ee.Authenticate()
85 ee.Initialize()
86
~\Anaconda3\lib\site-packages\ee_init_.py in Authenticate(authorization_code, quiet, code_verifier)
87 code_verifier: PKCE verifier to prevent auth code stealing.
88 """
---> 89 oauth.authenticate(authorization_code, quiet, code_verifier)
90
91
~\Anaconda3\lib\site-packages\ee\oauth.py in authenticate(cli_authorization_code, quiet, cli_code_verifier)
233 webbrowser.open_new(auth_url)
234
--> 235 _obtain_and_write_token(None, code_verifier) # Will prompt for auth_code.
~\Anaconda3\lib\site-packages\ee\oauth.py in _obtain_and_write_token(auth_code, code_verifier)
139 auth_code = input('Enter verification code: ')
140 assert isinstance(auth_code, six.string_types)
--> 141 token = request_token(auth_code.strip(), code_verifier)
142 write_token(token)
143 print('\nSuccessfully saved authorization token.')
~\Anaconda3\lib\site-packages\ee\oauth.py in request_token(auth_code, code_verifier)
88 except HTTPError as e:
89 raise Exception('Problem requesting tokens. Please try again. %s %s' %
---> 90 (e, e.read()))
91
92 return refresh_token
Exception: Problem requesting tokens. Please try again. HTTP Error 404: Not Found b'\n\n \n \n <title>Error 404 (Not Found)!!1</title>\n <style>\n {margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px} > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n \n
404. That\xe2\x80\x99s an error.\n
The requested URL
/o/oauth2/token
was not found on this server. That\xe2\x80\x99s all we know.\n'Beta Was this translation helpful? Give feedback.
All reactions