Closed gregorhd closed 5 months ago
Use geemap.ee_initialize() for or geemap.Map(), which can read the EARTHENGINE_TOKEN from the environment variable and authenticate EE. Never use ee.Authenticate() in the web app.
Beautiful! That was it. Thanks so much!
Thanks for your excellent tutorial on integrating Solara and Hugging Face.
If I were to not duplicate your repo but start out from scratch, what's the proper way to make sure a Solara/Geemap script on the HF Docker image is authenticated properly with GEE? I have my EARTHENGINE_TOKEN saved as a Spaces secret and use the same Dockerfile as you.
I noticed none of your scripts under /pages/ uses
ee.Authenticate()
oree.Initialise()
, so I didn't as well, yet when I push my Solara/Geemap script (which runs fine locally) to Hugging Face and the script is run after Builtime, I get:ee.ee_exception.EEException: Earth Engine client library not initialized. Run
ee.Initialize()``2) So I add
ee.Initialize()
to the script,git push
again, and get:3) When I then add
ee.Authenticate()
I get:Exception: gcloud command not found.
...which then makes me think I need to install the gcloud CLI on the image (managed that as well but more issues...).
This all makes me think, there's something simple I'm missing here. I tried duplicating your repo initially, but was also asked to ee.Initialize(ee) etc. after adding my own script to /pages/.
Thanks!