AfricaBirdData / ABAP

Code for downloading and working with data from the African Bird Atlas Project
Other
11 stars 1 forks source link

rgee needs python >= 3.5 #1

Closed patchcervan closed 2 years ago

patchcervan commented 2 years ago

This has nothing to do with ABAP, but there seems to be a problem when configuring the python environment from rgee/reticulate on Windows, which in turns prevents the use of GEE in ABAP. There is an open issue here. Until this is fixed, a possible workaround is to install a previous python version:

Go to windows search bar and type Anaconda. Open Anaconda prompt.

Type the following running one line at a time:

conda create -n rgee_py python=3.9
activate rgee_py
pip install google-api-python-client
pip install earthengine-api
pip install numpy

Go to RStudio and type:

rgee_environment_dir = "C:\\mypythonenvs\\envs\\rgee_py\\" # substitute mypythonenvs to match your actual path
reticulate::use_python(rgee_environment_dir, required = T)
rgee::ee_install_set_pyenv(
      py_path = rgee_environment_dir, # Change it for your own Python PATH
      py_env = "rgee_py" # Change it for your own Python ENV
)
Sys.setenv(RETICULATE_PYTHON = rgee_environment_dir)
Sys.setenv(EARTHENGINE_PYTHON = rgee_environment_dir)

Check if it worked: rgee::ee_check()

If it complains about earthengine-api version, you can repeat the above steps, but specifying the version of earthengine-api pip install earthengine-api==0.1277

Most of these steps were taken from ricds tutorial

patchcervan commented 2 years ago

The issue has been solved!. For now, one should install rgee from GitHub.