-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ee_Initialize immediately saying credentials expired #355
Comments
I also bumped into the same problem... |
I've just run into the same issue, though notably the same credentials file appears to work fine when going directly through the Python API directly in Reticulate or Jupyter. import ee
ee.Authenticate(auth_mode = 'localhost')
ee.Initialize() Then replacing this R code: ...
rgee::ee_Initialize()
... With ...
reticulate::py_run_file('[path to python script]')
... |
I have the same problem.. I authenticate gee and get the message that the authentication has been successful, but as soon as I then call ee_initialize(), I get the message that I should try running ee_authenticate and so the circle begins. Has anyone found a solution to this problem yet and could help me out? |
@llechler |
Hi @NicholasBerryman, thanks for reaching out. I just tried it by writing the python file and then calling it in R, but I get the error message in R "Error in py_run_file_impl (file, local, convert) : ModuleNotFoundError. No module named "ee". Some more details:
|
Hmm. Did you set your reticulate environment to the same one you use for rgee? If that workaround still doesn't work, we might have to wait for a more official solution. |
I successfully managed to use both your solution and also this code snippet to initialize the GEE
However, I still get the error message: |
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
The workaround doesn't fully work because it doesn't create the rgee_sessioninfo.txt file (indeed the initalization goes only through Python and rgee is created from R functions) |
I had this issue for quite some time. It took a lot of back and forth with google, R, and conda. I had rgee install miniconda, even though I had conda installed. Then, I set the conda environment to that location and I have had 0 problems since. #353 (comment) I hope this solution will help you. |
I think there are multiple layers of things going on here.
In version 0.1.383 of the earthengine-api there were changes that make specifying cloud projects more necessary. It appears to me that in I'm not sure what the fix is for the Do this instead of # Import rgee.
library(rgee)
# Attempt to authenticate. If credentials are found, nothing will happen except
# a return of TRUE. If credentials are not found, it'll take you through an auth
# flow and save the credentials. If you want to force reauthentication, include
# `force=TRUE` in the call. This is generally a one-time setup step.
ee$Authenticate(auth_mode='notebook')
# Initialize - this will connect to a project. You should always call this
# before working with rgee. It is IMPORTANT THAT YOU SPECIFY A PROJECT using
# the project parameter. If you forget what project IDs you have access to, find them
# here: console.cloud.google.com/project
ee$Initialize(project='YOUR-PROJECT') # <-- EDIT THIS FOR YOUR PROJECT
# Optionally make a request to verify you are connected.
ee$String('Hello from the Earth Engine servers!')$getInfo() |
The workaround allows ee_Initialise() to work for me but when running rgee functions I get the error message about the rgee_sessioninfo.txt file not being found. |
Hi all deeply sorry for all the problems regarding rgee.
I'm afraid I'm unable to continue maintaining rgee as much as I'd like to.
Besides, GEE has not been very friendly to third-party development, as the
legacy code isn't usually
maintained. Many strong updates are made on the server side (e.g. changes
in OAuth policies, etc.), We can't see these changes and we are not always
informed, which makes it quite
hard to keep up with the new features.
ee_Initialize was created with the idea of syncing between Drive API v3,
GCS, and EE. That is the reason we did so many checks internally,
unfortunately due to many changes that
GEE API made over time, a lot of patches were generated.
My recommendation, like @jdbcode, is not to use ee_Initialize or even rgee.
rgee was quite useful for many years, since the only way to retrieve data
was through GCS and Drive, and the idea was to make downloading easier
for R users, taking advantage of the fact that the R ecosystem is much more
stable than the Python one.
However, now you can move data from GEE without GGS and Drive. Actually,
you have six different ways to retrieve data! (totally insane)
- getInfo
- Export.image.toDrive
- Export.image.toGCS
- ee.data.getPixels
- ee.data.computePixels
- ee.data.getDownloadId
(I'm probably forgetting something else)
Some go faster than others, so it's best to see which one best suits your
activities.
Starting this weekend, I plan to patch rgee to get a more stable version,
in order to not break ongoing projects.
I will begin deprecating ee_install, ee_Initialize and download&upload
functions (e.g. ee_as_raster) because again there are now more efficient
solutions.
It is important to note that the GEE can change unexpectedly, and I can bet
they will. Therefore, if you require a more dependable option for your
applications or projects
in the long run, the best choice by far would be to use rstac and a STAC
data server.
El lun, 22 ene 2024 a las 11:32, Máire Kirkland ***@***.***>)
escribió:
… The workaround allows ee_Initialise() to work for me but when running rgee
functions I get the error message about the rgee_sessioninfo.txt file not
being found.
—
Reply to this email directly, view it on GitHub
<#355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD752PXRZJ3DEVOISEXRWF3YPZE3PAVCNFSM6AAAAABBNR2FJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTHAYTEMZZHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Dear Cesar, I get that you might feel discouraged. |
rgee is really very easy to use. R language environment + GEE is really a magic weapon for remote sensing data analysis. It is a pity to give up rgee. I hope rgee can continue to update. |
I am running in windows machine, R version 4.3.3. It worked when I downgrade the GEE API from version 0.1.391 to 0.1.370, see details in the comment: #353 (comment) |
Thank you! This worked for me |
This also worked for me! |
Sorry for referencing your comment after many months, but in case someone else gets into this problem after trying the workaround. I found a very dirty workaround to the workaround (I know, insane). Just set up your workaround as described above, and after the Explanation?: If I understand correctly, RGEE through python is able to do the initialization but since we are doing it through python, there is no |
Hi, your suggestion is very useful, but I can't initialize the regee with python first, so I can't generate a regee_sessioninfo.txt. |
Hi, sorry for not being clear. |
For me, it doesn't work:
and in my
or:
|
Have you tried just reinstalling both rgee and reticulate? Sometimes I had to do this (a few times) for the packages to work. |
What helped me, after going through all comments; enable earthengine API and register your project: see https://developers.google.com/earth-engine/guides/access |
At submit an issue, please attached the following information of your
rgee
session:Attach your Python (reticulate) configuration:
Description
Hi, I am trying to just get initialized into rgee and for some reason it is saying that my credentials are expired immediately after I run ee_Authenticate(). I can go and find the credentials in my machine and view them, and I can find them through R as well. It is giving me an error message:
Error in value[3L] :
It looks like your EE credential has expired. Try running ee_Authenticate() again or clean your credentials ee_clean_user_credentials().
I have ran both ee_Authenticate() and ee_clean_user_credentials() multiple times and have been unable to solve the issue. Can someone recreate this or point me in the right direction to solve it? The only issue that I can see happening is my computer is hooked up with Onedrive so I can work on both my personal and work computers from anywhere. I did have to move the credentials to match up with the path.expand() function; however, even that did not seem to solve the issue.
What I Did
The text was updated successfully, but these errors were encountered: