error authenticating with google earth engine (GEE)

45 views
Skip to first unread message

matthew...@gmail.com

unread,
Nov 9, 2022, 10:10:57 AM11/9/22
to Sepal Users
Hi SEPAL,

I have previously been able to run ee.Authenticate() with a jupyter notebook on SEPAL.

I have created a new notebook and when running ee.Authenticate(), I get a permission error. The authentication process completes on Google's side, I get the auth code and paste that into the auth box. Then I get the following error (below as png)

It reads to me like a SEPAL directory permission error?

Thanks,
Matt

gee_sepal_permission_error.png

Erik Lindquist

unread,
Nov 9, 2022, 10:45:28 AM11/9/22
to matthew...@gmail.com, Sepal Users
Hi Matt

You don't need to use ee.Authenticate.
It should work without that.
You may want to make sure you link your SEPAL account with your GEE account:

Hope it helps

Erik

--
You received this message because you are subscribed to the Google Groups "Sepal Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sepal-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sepal-users/30e5dee3-20ef-4bab-ac4b-ae83f6174d8dn%40googlegroups.com.

matthew...@gmail.com

unread,
Nov 9, 2022, 10:50:37 AM11/9/22
to Sepal Users
Hi Erik,

That's good to know. 

My SEPAL and GEE account are already linked : )

So the reason why I was using ee.Authenticate was because ee.Initialize returns the error "refresh_token":

ee_sepal_initialize_error.png

Daniel Guerrero

unread,
Nov 9, 2022, 11:11:32 AM11/9/22
to Sepal Users
Dear Matthew,

According to the error messages, apparently, you have created a virtual environment called "sepal_venv", right? did you install there the earth engine Python package?

If that's the case you could either use the default "Python" kernel or pip install the forked earth engine sepal package that can be found here: https://github.com/openforis/earthengi...@v0.1.270#egg=earthengine-api

Please let us know which option would you like to use so we can provide further details.

Best,

Daniel G.
SEPAL team

matthew...@gmail.com

unread,
Nov 9, 2022, 12:12:17 PM11/9/22
to Sepal Users
Hey Daniel,

Yes you're correct! I have installed earthengine-api into my custom venv, since the SEPAL supplied venvs didn't have the packages we needed.

Okay - I will pip install the sepal forked earthegine-api. Should ee.Initialize work after that?

For anyone reading - a temporary solution was to disconnect my google account, after that,  ee.Authenticate and ee.Initialize worked fine (google supplied default earthengine-api package)

All the best,
Matt 

Daniel Guerrero

unread,
Nov 10, 2022, 5:10:27 AM11/10/22
to Sepal Users
Hi Matthew,

You do not need to "ee.Authenticate" if you use SEPAL forked repository, it will get the credentials stored after linking with GEE
To perform the installation via pip, please do the following:

1. Go to your venv and active it:  source your_venv/bin/activate
2. Run forked openforis installation:  python -m pip install "git+https://github.com/openforis/earthengi...@v0.1.270#egg=earthengine-api&subdirectory=python" (In this case do not forget quotes wrapping the github repo with its vars).

I hope it will work for you,

Best


Daniel G. 
SEPAL team

Reply all
Reply to author
Forward
0 new messages