Test2
In [1]:
Copied!
import rasterarea
import rasterarea
In [2]:
Copied!
m = rasterarea.Map()
m
m = rasterarea.Map()
m
To authorize access needed by Earth Engine, open the following URL in a web browser and follow the instructions:
The authorization workflow will generate a code, which you should paste in the box below.
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) File ~/.local/lib/python3.9/site-packages/ee/data.py:228, in get_persistent_credentials() 227 try: --> 228 return Credentials(None, **oauth.get_credentials_arguments()) 229 except IOError: File ~/.local/lib/python3.9/site-packages/ee/oauth.py:72, in get_credentials_arguments() 71 def get_credentials_arguments(): ---> 72 with open(get_credentials_path()) as creds: 73 stored = json.load(creds) FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.config/earthengine/credentials' During handling of the above exception, another exception occurred: EEException Traceback (most recent call last) File ~/.local/lib/python3.9/site-packages/geemap/common.py:225, in ee_initialize(token_name, auth_mode, service_account) 223 copy_credentials_to_drive() --> 225 ee.Initialize(http_transport=httplib2.Http()) 226 except Exception: File ~/.local/lib/python3.9/site-packages/ee/__init__.py:130, in Initialize(credentials, opt_url, cloud_api_key, http_transport, project) 129 if credentials == 'persistent': --> 130 credentials = data.get_persistent_credentials() 131 data.initialize( 132 credentials=credentials, 133 api_base_url=(opt_url + '/api' if opt_url else None), (...) 137 project=project, 138 http_transport=http_transport) File ~/.local/lib/python3.9/site-packages/ee/data.py:230, in get_persistent_credentials() 229 except IOError: --> 230 raise ee_exception.EEException( 231 'Please authorize access to your Earth Engine account by ' 232 'running\n\nearthengine authenticate\n\n' 233 'in your command line, and then retry.') 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: StdinNotImplementedError Traceback (most recent call last) Cell In[2], line 1 ----> 1 m = rasterarea.Map() 2 m File ~/.local/lib/python3.9/site-packages/rasterarea/rasterarea.py:573, in Map.__init__(self, center, zoom, **kwargs) 570 if "scroll_wheel_zoom" not in kwargs: 571 kwargs["scroll_wheel_zoom"] = True --> 573 super().__init__(center=center, zoom=zoom, **kwargs) 574 self.toolbar = Toolbar(parent=self) File ~/.local/lib/python3.9/site-packages/geemap/geemap.py:52, in Map.__init__(self, **kwargs) 49 kwargs["ee_initialize"] = True 51 if kwargs["ee_initialize"]: ---> 52 ee_initialize() 54 # Default map center location (lat, lon) and zoom level 55 latlon = [20, 0] File ~/.local/lib/python3.9/site-packages/geemap/common.py:227, in ee_initialize(token_name, auth_mode, service_account) 225 ee.Initialize(http_transport=httplib2.Http()) 226 except Exception: --> 227 ee.Authenticate(auth_mode=auth_mode) 228 ee.Initialize(http_transport=httplib2.Http()) File ~/.local/lib/python3.9/site-packages/ee/__init__.py:103, in Authenticate(authorization_code, quiet, code_verifier, auth_mode, scopes) 77 def Authenticate( 78 authorization_code=None, 79 quiet=None, 80 code_verifier=None, 81 auth_mode=None, 82 scopes=None): 83 """Prompts the user to authorize access to Earth Engine via OAuth2. 84 85 Args: (...) 101 (auth_url, code_verifier) when called with quiet='init_only' 102 """ --> 103 return oauth.authenticate(authorization_code, quiet, code_verifier, auth_mode, 104 scopes) File ~/.local/lib/python3.9/site-packages/ee/oauth.py:408, in authenticate(cli_authorization_code, quiet, cli_code_verifier, auth_mode, scopes) 405 if flow.display_instructions(quiet): 406 _open_new_browser(flow.auth_url) --> 408 flow.save_code() File ~/.local/lib/python3.9/site-packages/ee/oauth.py:451, in Flow.save_code(self, code) 449 redirect_uri = self.server.url 450 code = self.server.fetch_code() # Waits for oauth callback --> 451 _obtain_and_write_token(code, self.code_verifier, self.scopes, redirect_uri) File ~/.local/lib/python3.9/site-packages/ee/oauth.py:179, in _obtain_and_write_token(auth_code, code_verifier, scopes, redirect_uri) 177 client_info['redirect_uri'] = redirect_uri 178 if not auth_code: --> 179 auth_code = input('Enter verification code: ') 180 assert isinstance(auth_code, str) 181 scopes = scopes or SCOPES File ~/.local/lib/python3.9/site-packages/ipykernel/kernelbase.py:1190, in Kernel.raw_input(self, prompt) 1188 if not self._allow_stdin: 1189 msg = "raw_input was called, but this frontend does not support input requests." -> 1190 raise StdinNotImplementedError(msg) 1191 return self._input_request( 1192 str(prompt), 1193 self._parent_ident["shell"], 1194 self.get_parent("shell"), 1195 password=False, 1196 ) StdinNotImplementedError: raw_input was called, but this frontend does not support input requests.
Last update:
2023-05-11