0

Putting this up here mostly so that if I find a solution I can place it here for others. I am trying to use the package rgee to interface with Google Earth Engine via R/Rstudio. I have downloaded rgee with install.packages("rgee", dependencies = T). However, running ee_Initialize() when the expected authorization window opens up it states:

    Error 400: invalid_request
    The version of the app you're using doesn't include the latest security features to keep you protected. 
Please make sure to download from a trusted source and update to the latest, most secure version.

Issues relating to this and similar errors on rgee's github haven't led to any solutions for me. I will update this post once I've figured it out.

### R/python packages
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Python 3.8
rgee_1.1.3 
reticulate_1.25

### system
2020 MacBook Pro M1 Monterey 12.4 
R Studio 2022.07.0 Build 548
milo
  • 25
  • 4

2 Answers2

0

This is usually related to your non-R settings. Try to:

ee_install
ee_install_set_pyenv
ee_install_upgrade

Follow the rgee guide for a full setup

vivirbr
  • 103
  • 10
  • hmm, I had previously used ee_install() without luck. I have just tried the next two without luck still. In fact new errors are appearing now. `ee_install_set_pyenv(py_path="/Users/[redacted]/Library/r-miniconda-arm64/envs/r-reticulate/bin/python", py_env = "ee")` runs without trouble but running `ee_Initialize()` after restarting session returns: `The current Python PATH: /Users/[redacted]/Library/r-miniconda-arm64/bin/python does not have the Python package "earthengine-api" installed.` Weird becuase the path is different than what I specified in `ee_install_set_pyenv` – milo Jul 12 '22 at 18:59
  • I was able to use Global Options in Rstudio to set a py interpreter for 3.8.9 that includes associated ee-api, numpy, etc. `rgee::ee_check()` passes. This eliminated the new errors mentioned above but`rgee::ee_Initialize()` still returns the Error 404 in my OP. – milo Jul 12 '22 at 19:18
  • Hi @milo you are maybe facing the same as the topic is describing here: https://stackoverflow.com/questions/32014466/eeexception-server-returned-http-code-404-testing-app-with-google-app-engi – vivirbr Jul 14 '22 at 08:33
0

Additionally installing gcloud (Windows) solved it for me: https://cloud.google.com/sdk/docs/install

Then this should work:

ee_install
ee_install_set_pyenv
ee_install_upgrade
ee_Initialize

## R version 4.2.1
## Python v3.9
## rgee_1.1.4 
## reticulate_1.26
camve
  • 1