I first created an account and a project with Google Earth Engine.
Then I installed and loaded the rgee
package:
install.packages("rgee")
library(rgee)
I checked if python is installed:
> reticulate::py_available()
[1] FALSE
And installed it on my system:
> reticulate::py_discover_config()
python: /usr/bin/python
libpython: /usr/lib64/libpython3.13.so.1.0
pythonhome: //usr://usr
version: 3.13.5 (main, Jun 12 2025, 00:00:00) [GCC 15.1.1 20250521 (Red Hat 15.1.1-2)]
numpy: /usr/lib64/python3.13/site-packages/numpy
numpy_version: 2.2.6
ee: /home/saidmaanan/.local/lib/python3.13/site-packages/ee
NOTE: Python version was forced by use_python() function
> rgee::ee_install_set_pyenv(py_path = "/usr/bin/python", py_env = "rgee")
EARTHENGINE_PYTHON='/usr/bin/python'
EARTHENGINE_ENV='rgee'
saved in: /home/saidmaanan/.Renviron
Do you want restart your R session? Windows users could need to terminate R instead of restarting.
1: yes
2: no
Selection: 1
Restarting R session...
>
I checked if everything is installed properly, and it gave me this:
> rgee::ee_check()
◉ Python version
✔ [Ok] /usr/bin/python v3.13
Error in strsplit(a, "[.-]") : non-character argument
What is the cause of this error? And how do I address it?
Here is some information about my machine:
As suggested in the comment below, I ignored the error above, and proceeded with the following:
> rgee:::ee_check_python_packages()
◉ Python packages:
✔ [Ok] numpy
✔ [Ok] earthengine-api
NOTE: The Earth Engine Python API version 1.5.24 is installed
correctly in the system but rgee was tested using the version
0.1.370. To avoid possible issues, we recommend install the
version used by rgee (0.1.370). You might use:
* rgee::ee_install_upgrade()
* reticulate::py_install('earthengine-api==0.1.370', envname='PUT_HERE_YOUR_PYENV')
* pip install earthengine-api==0.1.370 (Linux and Mac0S)
* conda install earthengine-api==0.1.370 (Linux, Mac0S, and Windows)
>
> rgee:::ee_check_credentials()
◉ Credentials neccesaries for rgee:
✔ [Ok] Earth Engine Credentials found.
✔ [Ok] Google Drive credentials found.
✔ [Ok] Google Cloud Storage credentials found.
>
But then while initializing the Earth Engine, I stumbled upon another error:
> # initialize Earth Engine
> rgee::ee_Initialize(
+ user = "maanan.said@gmail.com"
+ )
── rgee 1.1.7 ────────────────────────────────────────────────────────────────────────────────────────── earthengine-api 1.5.24 ──
✔ user: maanan.said@gmail.com
✔ Initializing Google Earth Engine: DONE!
Error in value[[3L]](cond) :
It looks like your EE credential has expired. Try running ee_Authenticate() again or clean your credentials ee_clean_user_credentials().
I tried to reinitialize my credentials, but the error persists:
> rgee::ee_clean_user_credentials(user = "maanan.said@gmail.com")
> # initialize Earth Engine
> rgee::ee_Initialize(
+ user = "maanan.said@gmail.com"
── rgee 1.1.7 ────────────────────────────────────────────────────────────────────────────────────────── earthengine-api 1.5.24 ──
✔ user: maanan.said@gmail.com
✔ Initializing Google Earth Engine:
Opening in existing browser session.
Enter verification code: 4/1AVMBsJjrMNc8YFpydvgq9xzJtHurdWOFt5hw7MqTdkWOPgE9cB2_nvYBSSg
To authorize access needed by Earth Engine, open the following URL in a web browser and follow the instructions. If the web browser does not start automatically, please manually browse the URL below.
https://code.earthengine.google.com/client-auth?scopes=https%3A//www.googleapis.com/auth/earthengine%20https%3A//www.googleapis.com/auth/cloud-platform%20https%3A//www.googleapis.com/auth/drive%20https%3A//www.googleapis.com/auth/devstorage.full_control&request_id=u4pIqquXNMJlx6fcGzpbuvv24bcsxwGWvKGSPbHGgak&tc=kQam27-k84oXxo5xO5F9EvU8tqhheHiL_ZwxuOPnzb4&cc=oNAJMZ41t98bRvSeKG2p0bsl-PPDV6GQ1h3tpT3aDNo
The authorization workflow will generate a code, which you should paste in the box below.
✔ Initializing Google Earth Engine: DONE!
Successfully saved authorization token.
Error in value[[3L]](cond) :
It looks like your EE credential has expired. Try running ee_Authenticate() again or clean your credentials ee_clean_user_credentials().
The problem was due to version incompatibility between rgee
, the installed earthengine-api
python package, and the python version 3.13.
To address the problem, I first I installed python 3.11, and created a fresh python environment just for rgee
:
rgee::ee_install_python(py_env = "rgee", py_version = "3.11")
rgee::ee_install_set_pyenv(py_path = "/usr/bin/python3.11", py_env = "rgee")
Then I downgraded earthengine-api
to 0.1.370:
reticulate::py_install('earthengine-api==0.1.370', envname = "rgee")
And then cleaned credentials and re-authenticated:
rgee::ee_clean_user_credentials(user = "maanan.said@gmail.com")
rgee::ee_Initialize(user = "maanan.said@gmail.com", drive = TRUE, gcs = TRUE)