TransWikia.com

Permission denied when trying to Initialize google earth engine

Geographic Information Systems Asked on November 26, 2021

I was following the google earth engine documentation here. I added all the files in the root of my project as per the documentation. These files are the config.py and the privatekey.json. I then wrote the following code:

import ee
service_account = '<service-acc>@<project-id>.iam.gserviceaccount.com'
credentials = ee.ServiceAccountCredentials(service_account, 'privatekey.json')
ee.Initialize(credentials)

When I run this code, I got this error:

Traceback (most recent call last):
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/ee/data.py", line 345, in _execute_cloud_call
    return call.execute(num_retries=num_retries)
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/googleapiclient/http.py", line 907, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/algorithms?prettyPrint=false&alt=json returned "Permission denied.">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/ee/__init__.py", line 125, in Initialize
    ApiFunction.initialize()
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/ee/apifunction.py", line 154, in initialize
    signatures = data.getAlgorithms()
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/ee/data.py", line 1052, in getAlgorithms
    return _cloud_api_utils.convert_algorithms(_execute_cloud_call(call))
  File "/home/thuha/miniconda3/envs/prj/lib/python3.8/site-packages/ee/data.py", line 347, in _execute_cloud_call
    raise _translate_cloud_exception(e)
ee.ee_exception.EEException: Permission denied.

I need to know what makes that error appear when I want to initialize.

Google documentation

One Answer

Are you already signed up for GEE as it may result as an issue due to not having been signed up for GEE.

Kindly refer here https://github.com/google/earthengine-api/issues/27#issuecomment-581268589

Answered by jkariukidev on November 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP