Closed TianyaImpression closed 11 months ago
I tried running ee_Authenticate() , ee_clean_user_credentials(), again and again, it always throw this mistake.
I am having the same issue - I received the same error after running ee_Initialize() and ee_Authenticate and ee_clean_user_credintials() do not seem to help.
UPDATE: After some digging it looks like this may an issue with account setup and permissions in Google Cloud.
I have been able to get ee_Authenticate() to work in a Python notebook, but so far not in rgee. I had to make sure my Google Cloud project had the correct permission settings using the following URL and following instructions for "Enable the Earth Engine API". I also had to create credentials in Google Cloud for the GEE API in order to successfully authenticate in Python.
https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup
After doing the above, I was able to get the Python API to authenticate, but rgee still throws the same error.
UPDATE 2: I have solved this issue on my end. I installed gcloud CLI following these instructions: https://cloud.google.com/sdk/docs/install#windows
After installation I restarted R and ee_Initialize() no longer throws this error. Hope this helps
I remember that the latest version of rgee does not require the gcloud CLI
. You can refer to the installation section in this Zhihu blog for configuring rgee.
Hi, I had the same issue as @TianyaImpression. In my case, I solved it by downgrading my earthengine-api package to (earthengine-api==0.1.370)
Terminal:
python3 -m venv ~/.virtualenvs/rgee
source ~/.virtualenvs/rgee/bin/activate
pip install earthengine-api==0.1.370
R: restart session and type:
reticulate::use_python("/path/to/your/venv/.../rgee/bin/python3")
ee_Initialize()
Hi, I had the same issue as @TianyaImpression. In my case, I solved it by downgrading my earthengine-api package to (earthengine-api==0.1.370)
Terminal:
python3 -m venv ~/.virtualenvs/rgee source ~/.virtualenvs/rgee/bin/activate pip install earthengine-api==0.1.370
R: restart session and type:
reticulate::use_python("/path/to/your/venv/.../rgee/bin/python3") ee_Initialize()
I am using this version of the earthengine-api, but failed.
I am having the same issue - I received the same error after running ee_Initialize() and ee_Authenticate and ee_clean_user_credintials() do not seem to help.
UPDATE: After some digging it looks like this may an issue with account setup and permissions in Google Cloud.
I have been able to get ee_Authenticate() to work in a Python notebook, but so far not in rgee. I had to make sure my Google Cloud project had the correct permission settings using the following URL and following instructions for "Enable the Earth Engine API". I also had to create credentials in Google Cloud for the GEE API in order to successfully authenticate in Python.
https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup
After doing the above, I was able to get the Python API to authenticate, but rgee still throws the same error.
UPDATE 2: I have solved this issue on my end. I installed gcloud CLI following these instructions: https://cloud.google.com/sdk/docs/install#windows
After installation I restarted R and ee_Initialize() no longer throws this error. Hope this helps
I have installed the gcloud CLI, but I still can't Initizing GEE.
I am having the same issue - I received the same error after running ee_Initialize() and ee_Authenticate and ee_clean_user_credintials() do not seem to help. UPDATE: After some digging it looks like this may an issue with account setup and permissions in Google Cloud. I have been able to get ee_Authenticate() to work in a Python notebook, but so far not in rgee. I had to make sure my Google Cloud project had the correct permission settings using the following URL and following instructions for "Enable the Earth Engine API". I also had to create credentials in Google Cloud for the GEE API in order to successfully authenticate in Python. https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup After doing the above, I was able to get the Python API to authenticate, but rgee still throws the same error. UPDATE 2: I have solved this issue on my end. I installed gcloud CLI following these instructions: https://cloud.google.com/sdk/docs/install#windows After installation I restarted R and ee_Initialize() no longer throws this error. Hope this helps
I have installed the gcloud CLI, but I still can't Initizing GEE.
Have you verified that your Cloud project has the Earth Engine API enabled? I had to go in and manually change it after the latest update to the authentication system.
I am having the same issue - I received the same error after running ee_Initialize() and ee_Authenticate and ee_clean_user_credintials() do not seem to help. UPDATE: After some digging it looks like this may an issue with account setup and permissions in Google Cloud. I have been able to get ee_Authenticate() to work in a Python notebook, but so far not in rgee. I had to make sure my Google Cloud project had the correct permission settings using the following URL and following instructions for "Enable the Earth Engine API". I also had to create credentials in Google Cloud for the GEE API in order to successfully authenticate in Python. https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup After doing the above, I was able to get the Python API to authenticate, but rgee still throws the same error. UPDATE 2: I have solved this issue on my end. I installed gcloud CLI following these instructions: https://cloud.google.com/sdk/docs/install#windows After installation I restarted R and ee_Initialize() no longer throws this error. Hope this helps
I have installed the gcloud CLI, but I still can't Initizing GEE.
Have you verified that your Cloud project has the Earth Engine API enabled? I had to go in and manually change it after the latest update to the authentication system.
I have enabled the Earth Engine API, but also failed.
I had the same problem, however I have solved this problem just by executing the following codes:
> rgee::ee_install_upgrade()
> ee_Initialize()
── rgee 1.1.7 ───────────────────── earthengine-api 0.1.370 ──
✔ user: not_defined
✔ Initializing Google Earth Engine: DONE!
✔ Earth Engine account: users/geografo2023
✔ Python Path: C:/Users/USER/AppData/Local/r-miniconda/envs/rgee/python.exe
──────────────────────────────────────────────────────────────
👀
I had the same problem, however I have solved this problem just by executing the following codes:
> rgee::ee_install_upgrade() > ee_Initialize() ── rgee 1.1.7 ───────────────────── earthengine-api 0.1.370 ── ✔ user: not_defined ✔ Initializing Google Earth Engine: DONE! ✔ Earth Engine account: users/geografo2023 ✔ Python Path: C:/Users/USER/AppData/Local/r-miniconda/envs/rgee/python.exe ──────────────────────────────────────────────────────────────
👀
I had the same exact issue and this worked for me. Thank you!
I had the same problem, however I have solved this problem just by executing the following codes:
> rgee::ee_install_upgrade() > ee_Initialize() ── rgee 1.1.7 ───────────────────── earthengine-api 0.1.370 ── ✔ user: not_defined ✔ Initializing Google Earth Engine: DONE! ✔ Earth Engine account: users/geografo2023 ✔ Python Path: C:/Users/USER/AppData/Local/r-miniconda/envs/rgee/python.exe ──────────────────────────────────────────────────────────────
👀
I did this and rgee prompted a Google verification window. When I copied and pasted the code into Rstudio, it just froze my system and didn't do anything. It was "processing" for hours.
Then, after terminating my R session (I'm on windows), rgee said it didn't have numpy or earthengine api installed... so I reinstalled via ee_install. Now, I am stuck in this loop of "you don't have credentials, so use eeInitialize()", ""Your credentials have expired, use ee"Authenticate()", "you don't have credentials"... and so on. clean credentials does nothing either.
Maybe python version need upgrade,I updated my python version to 3.9.5 by terminal, and run ee_install_upgrade() in Rstuio, then the error fixed!
To solve this issue on my machine, I had to 1) install the newest python and minconda via rgee 2) remove the old python version from my machine 3) run ee_install() and terminate my R session 4) run ee_install_upgrade() 5) run ee_Initialize(). Then, rgee finally gave me the authentication window and worked normally. I also upgraded my R to 4.3.2. It just keeps failing with anything older for me.
I think adding some more details in the messages that rgee generates would be helpful. I have spent countless hours installing, reinstalling, and detaching rgee over the last few months just to get it to work. For example, when I was faced with the authentication loop (see my previous message), all that rgee said was to run ee_Authenticate, which didn't help the issue at all. It would have been better to suggest installing the latest version of rgee, re-installing the package, etc. Just a few more suggestions or tips to get the package to work would be all that is needed, in my opinion.
I also had this problem using both the cran and development version of rgee on Windows. To resolve, I ran conda activate -p "path\to\rgee"
, then conda install earthengine-api=0.1.370
.
After that, it worked fine, though I get a message telling me to upgrade to 0.1.384 (which breaks everything again).
I also had this problem using both the cran and development version of rgee on Windows. To resolve, I ran
conda activate -p "path\to\rgee"
, thenconda install earthengine-api=0.1.370
.After that, it worked fine, though I get a message telling me to upgrade to 0.1.384 (which breaks everything again).
I encountered something similar when I upgraded. Have you tried removing your old python environment completely, then reinstalling rgee via github?
I am still getting this issue, even though I resolved it 2 weeks ago. I had to re-run install upgrade AND authenticate. I also found that you must check all the permissions for the authorization code to work. I am clueless as to what the issue is, since it successfully installed last time.
I think there are multiple layers of things going on here.
ee_Initialize
is quite complicated - lots of checks that users are setup correctly. The error message is coming from a check on a call to get user/project assets - this appears to check that a person has a home folder for assets, and if not it tries to create one for them - this is quite outdated now that Cloud projects are the standard method for asset management.
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 ee_Initialize
the ee_check_root_folder
call is not successful because a specific project is not being passed during initialization, so access is blocked and we get the [probably] wrongly attributed error message about expired credentials.
I'm not sure what the fix is for the ee_Initialize
function, but people can do their own authentication and initialization just using the Earth Engine client library to bypass checks that are outdated in ee_Initialize
, which is what you'd do in a Jupyter notebook, for instance.
Do this instead of ee_Initialize
until it is updated:
# 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()
I am running in windows machine, R version 4.3.3. Python version 3.8.18 (conda with reticulate)
It worked when I downgrade the GEE API from version 0.1.391 to 0.1.370 with:
library(reticulate)
py_config() # see the name of your conda (python) environment, in my case "r-reticulate"
reticulate::py_install('earthengine-api==0.1.370', envname='r-reticulate')
# Check the installation of "earthengine-api" with
py_list_packages()
pyl <- py_list_packages()
pyl[pyl$package == "earthengine-api", ]
# check python version with
py_run_string("import sys; print(sys.version)")
My GEE account is used normally. When I started rgee, I always did not respond to the third step Initializing Google Earth Engine for a long time, and then throw a mistake. Can you help me?Thank you!