gee-community/geemap

after entering m = gee map.Map()

douglagug opened this issue · 3 comments

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.

shows a table of my system and gee map versioning

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'