gee-community/geemap

I cannot use geemap with my ArcGIS Pro

edmondcheng3021 opened this issue · 3 comments

What I did

I was following your youtube GEE Tutorial 131, at 6:31, I typed the code in ArcGIS Pro

Map = geemap.Map()
Map

What happened

Then I had this message, and I could not open the map in ArcGIS Pro

To authorize access needed by Earth Engine, open the following URL in a web browser and follow the instructions. If the web browser does not start automatically, please manually browse the URL below.

    https://code.earthengine.google.com/client-auth?scopes=https%3A//www.googleapis.com/auth/earthengine%20https%3A//www.googleapis.com/auth/devstorage.full_control&request_id=gXTKp0b2_bwzlCXugH3IKKLJgqMN7mRI54MIwwEu2Wg&tc=yNzwjAbL7Q13Frkc8WkvvFCi1vzoCiPeSU7hWI5okwM&cc=bd-KQvNN-e1OZpKAP-PbN6v9P1Q6p1xW9oIcbyDeDxM

The authorization workflow will generate a code, which you should paste in the box below.
Enter verification code: 4/1AWtgzh6_zFrDfEpz83J5qPwjJg7Gs2QCCHY74g8LcEsAIeY9d8j63thb-gQ

Successfully saved authorization token.
---------------------------------------------------------------------------
EEException                               Traceback (most recent call last)
In  [4]:
Line 1:     Map = geemap.Map()

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\geemap\geemap.py, in __init__:
Line 51:    ee_initialize()

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\geemap\common.py, in ee_initialize:
Line 228:   ee.Initialize(http_transport=httplib2.Http())

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\__init__.py, in Initialize:
Line 140:   ApiFunction.initialize()

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\apifunction.py, in initialize:
Line 154:   signatures = data.getAlgorithms()

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\data.py, in getAlgorithms:
Line 1250:  return _cloud_api_utils.convert_algorithms(_execute_cloud_call(call))

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\data.py, in _execute_cloud_call:
Line 331:   raise _translate_cloud_exception(e)

EEException: Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access

---------------------------------------------------------------------------
giswqs commented

The error message is very clear. Your GEE account is not authorized to use the Python API. Try the following code. If it does not work, then it is your account problem, not a geemap problem.

import ee
ee.Authenticate()
ee.Initialize()

I reconfirmed my Google Earth Engine account and tried the code

ee.Authenticate()
ee.Initialize()

this is the outcome

Fetching credentials using gcloud
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
In  [6]:
Line 2:     ee.Authenticate()

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\__init__.py, in Authenticate:
Line 104:   scopes)

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\oauth.py, in authenticate:
Line 400:   _load_app_default_credentials(auth_mode == 'gcloud', scopes, quiet)

File C:\Users\user\AppData\Local\ESRI\conda\envs\GEE\lib\site-packages\ee\oauth.py, in _load_app_default_credentials:
Line 301:   raise Exception('gcloud command not found. ' + tip) from e

Exception: gcloud command not found. Please ensure that gcloud is installed.
More information: https://developers.google.com/earth-engine/guides/python_install

---------------------------------------------------------------------------

I am so sorry if this is a silly problem. I am a complete beginner of coding

giswqs commented
import ee
ee.Authenticate(auth_mode="notebook")
ee.Initialize()