Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after entering m = gee map.Map() #2084

Closed
douglagug opened this issue Jul 18, 2024 · 3 comments
Closed

after entering m = gee map.Map() #2084

douglagug opened this issue Jul 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@douglagug
Copy link

Environment Information

Please run the following code on your computer and share the output with us so that we can better debug your issue:

import geemap
geemap.Report()

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
@douglagug douglagug added the bug Something isn't working label Jul 18, 2024
@douglagug
Copy link
Author

shows a table of my system and gee map versioning

@giswqs
Copy link
Member

giswqs commented Jul 18, 2024

See #1870 (comment)

@giswqs giswqs closed this as completed Jul 18, 2024
@douglagug
Copy link
Author

this is the error I get after adding the Google verification code
PermissionError Traceback (most recent call last)
File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/oauth.py:177, in write_private_json(json_path, info_dict)
176 try:
--> 177 os.makedirs(dirname)
178 except OSError as e:

File /opt/miniconda3/envs/gee/lib/python3.8/os.py:223, in makedirs(name, mode, exist_ok)
222 try:
--> 223 mkdir(name, mode)
224 except OSError:
225 # Cannot rely on checking for EEXIST, since the operating system
226 # could give priority to other errors like EACCES or EROFS

PermissionError: [Errno 13] Permission denied: '/Users/douglasgray/.config/earthengine'

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[3], line 1
----> 1 m = geemap.Map()
2 m

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/geemap/geemap.py:121, in Map.init(self, **kwargs)
119 self._USER_AGENT_PREFIX = "geemap"
120 self.kwargs = kwargs
--> 121 super().init(**kwargs)
122 self._var_name = "Map" # The Map variable name for converting JS to Python
124 if kwargs.get("height"):

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/geemap/core.py:494, in Map.init(self, **kwargs)
492 # Authenticate and initialize EE.
493 if kwargs.get("ee_initialize", True):
--> 494 common.ee_initialize(user_agent_prefix=self._USER_AGENT_PREFIX)
496 # Listen for layers being added/removed so we can update the layer manager.
497 self.observe(self._on_layers_change, "layers")

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/geemap/common.py:154, in ee_initialize(token_name, auth_mode, service_account, auth_args, user_agent_prefix, project, **kwargs)
151 ee.Initialize(**kwargs)
153 except Exception:
--> 154 ee.Authenticate(**auth_args)
155 ee.Initialize(**kwargs)
157 ee.data.setUserAgent(user_agent)

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/init.py:124, in Authenticate(authorization_code, quiet, code_verifier, auth_mode, scopes, force)
93 def Authenticate(
94 authorization_code: Optional[str] = None,
95 quiet: Optional[bool] = None,
(...)
99 force: bool = False,
100 ) -> Optional[bool]:
101 """Prompts the user to authorize access to Earth Engine via OAuth2.
102
103 Args:
(...)
122 True if we found valid credentials and didn't run the auth flow.
123 """
--> 124 return oauth.authenticate(authorization_code, quiet, code_verifier, auth_mode,
125 scopes, force)

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/oauth.py:512, in authenticate(cli_authorization_code, quiet, cli_code_verifier, auth_mode, scopes, force)
509 if flow.display_instructions(quiet):
510 _open_new_browser(flow.auth_url)
--> 512 flow.save_code()

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/oauth.py:562, in Flow.save_code(self, code)
560 redirect_uri = self.server.url
561 code = self.server.fetch_code() # Waits for oauth callback
--> 562 _obtain_and_write_token(code, self.code_verifier, self.scopes, redirect_uri)

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/oauth.py:247, in _obtain_and_write_token(auth_code, code_verifier, scopes, redirect_uri)
245 client_info['refresh_token'] = token
246 client_info['scopes'] = scopes
--> 247 write_private_json(get_credentials_path(), client_info)
248 print('\nSuccessfully saved authorization token.')

File /opt/miniconda3/envs/gee/lib/python3.8/site-packages/ee/oauth.py:181, in write_private_json(json_path, info_dict)
178 except OSError as e:
179 if e.errno != errno.EEXIST:
180 # pylint:disable=broad-exception-raised,raise-missing-from
--> 181 raise Exception('Error creating directory %s: %s' % (dirname, e))
182 # pylint:enable=broad-exception-raised,raise-missing-from
184 file_content = json.dumps(info_dict)

Exception: Error creating directory /Users/douglasgray/.config/earthengine: [Errno 13] Permission denied: '/Users/douglasgray/.config/earthengine'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants