r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
677 stars 146 forks source link

Problem with rgee in Rstudio inside Anaconda #206

Closed Leprechault closed 2 years ago

Leprechault commented 2 years ago
library(reticulate)
py_config()
python:         C:/Users/Ronald/anaconda3/python.exe
libpython:      C:/Users/Ronald/anaconda3/python39.dll
pythonhome:     C:/Users/Ronald/anaconda3
version:        3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/Ronald/anaconda3/Lib/site-packages/numpy
numpy_version:  1.20.3
ee:             [NOT FOUND]

python versions found: 
 C:/Users/Ronald/anaconda3/python.exe
 C:/Users/Ronald/anaconda3/envs/rgee/python.exe

I try several times and nothing worked for me to install the rgee in Rstudio inside Anaconda. I always the output error:

Error in ee_connect_to_py(path = ee_current_version, n = 5) : 
  The current Python PATH: C:/Users/Ronald/anaconda3/python.exe
does not have the Python package "earthengine-api" installed. Are you restarted/terminated.
your R session after install miniconda or run ee_install()?
If no do it, please try again:
> ee_install(): To create and set a Python environment with all rgee dependencies.
> ee_install_set_pyenv(): To set a specific Python environment.
In addition: Warning messages:
1: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\Ronald\anaconda3\envs\rstudium/python.exe": O sistema não pode encontrar o arquivo especificado
2: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\Ronald\anaconda3\envs\rstudium/python.exe": O sistema não pode encontrar o arquivo especificado
3: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\Ronald\anaconda3\envs\rstudium/python.exe": O sistema não pode encontrar o arquivo especificado
4: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\Ronald\anaconda3\envs\rstudium/python.exe": O sistema não pode encontrar o arquivo especificado

Inside the Anaconda when I try to install inside rgee environment the output error is:

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package openssl conflicts for:
python=3.10 -> openssl[version='>=1.1.1l,=3.0.0,rstudio -> qt=5.6 -> openssl=1.0

Package vc conflicts for:
rstudio -> freetype[version='>=2.9.1'] -> vc[version='9.*|>=14.1,rstudio -> vc=14

Package vs2015_runtime conflicts for:
rstudio -> vs2015_runtime
rstudio -> freetype[version='>=2.9.1'] -> vs2015_runtime[version='>=14.0.25123,=14.0.25420|>=14.15.26706|>=14.16.27012,=14.27.29016|>=14.16.27012|>=14.28.29325']

Package zlib conflicts for:
rstudio -> freetype[version='>=2.9.1'] -> zlib[version='>=1.2.11,rstudio -> zlib[version='>=1.2']

Please, any help with it

csaybar commented 2 years ago

Hi, it is a problem with python3.10 and (reticulate) miniconda in windows.

https://github.com/r-spatial/rgee/issues/196#issuecomment-973603808

You will find the code to install here: https://github.com/ricds/DL_RS_GEE/blob/main/rgee_install_packages.R and a video tutorial here: https://www.youtube.com/watch?v=1-k6wNL2hlo

csaybar commented 2 years ago

Hi @Leprechault the problem has been solved!. Please run as follow to fix!

remotes::install_github("r-spatial/rgee")
library(rgee)
ee_install()