r-spatial / rgee

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

When run ee_check() something wrong with gcloud #320

Closed SpatLyu closed 1 year ago

SpatLyu commented 1 year ago

At submit an issue, please attached the following information of your rgee session:

Earth Engine Command Line Interface.

optional arguments: -h, --help show this help message and exit --ee_config EE_CONFIG Path to the earthengine configuration file. Defaults to "~/.config\earthengine\credentials". --service_account_file SERVICE_ACCOUNT_FILE Path to a service account credentialsfile. Overrides any ee_config if specified. --project PROJECT_OVERRIDE Specifies a Google Cloud Platform Project id to override the call.

Commands: {authenticate,acl,asset,cp,create,ls,licenses,du,mv,model,rm,set_project,task,unset_project,upload,upload_manifest,upload_table_manifest} authenticate Prompts the user to authorize access to Earth Engine via OAuth2. acl Prints or updates the access control list of the specified asset. asset Prints or updates metadata associated with an Earth Engine asset. cp Creates a new Earth Engine asset as a copy of another asset. create Creates assets and folders. ls Prints the contents of a folder or collection. licenses Prints the name and license of all third party dependencies. du Prints the size and names of all items in a given folder or collection. mv Moves or renames an Earth Engine asset. model TensorFlow model related commands. rm Deletes the specified assets. set_project Sets the default user project to be used for all API calls. task Prints information about or manages long-running tasks. unset_project UnSets the default user project to be used for all API calls. upload Uploads assets to Earth Engine. upload_manifest Uploads an image to Earth Engine using the given manifest file. upload_table_manifest Uploads a table to Earth Engine using the given manifest file.

library(rgee)

# Initialize the Earth Engine module.
ee_Initialize()

# Print metadata for a DEM dataset.
print(ee$Image('USGS/SRTMGL1_003')$getInfo())

$type [1] "Image"

$bands $bands[[1]] $bands[[1]]$id [1] "elevation"

$bands[[1]]$data_type $bands[[1]]$data_type$type [1] "PixelType"

$bands[[1]]$data_type$precision [1] "int"

$bands[[1]]$data_type$min [1] -32768

$bands[[1]]$data_type$max [1] 32767

$bands[[1]]$dimensions [1] 1296001 417601

$bands[[1]]$crs [1] "EPSG:4326"

$bands[[1]]$crs_transform $bands[[1]]$crs_transform[[1]] [1] 0.0002777778

$bands[[1]]$crs_transform[[2]] [1] 0

$bands[[1]]$crs_transform[[3]] [1] -180.0001

$bands[[1]]$crs_transform[[4]] [1] 0

$bands[[1]]$crs_transform[[5]] [1] -0.0002777778

$bands[[1]]$crs_transform[[6]] [1] 60.00014

$id [1] "USGS/SRTMGL1_003"

$version [1] -1

$properties $properties$system:visualization_0_min [1] "0.0"

$properties$type_name [1] "Image"

$properties$keywords [1] "dem" "elevation" "geophysical" "nasa" "srtm" "topography" [7] "usgs"

$properties$thumb [1] "https://mw1.google.com/ges/dd/images/SRTM90_V4_thumb.png"

$properties$description [1] "

The Shuttle Radar Topography Mission (SRTM, see <a href=\"https://onlinelibrary.wiley.com/doi/10.1029/2005RG000183/full\">Farr\net al. 2007)\ndigital elevation data is an international research effort that\nobtained digital elevation models on a near-global scale. This\nSRTM V3 product (SRTM Plus) is provided by NASA JPL\nat a resolution of 1 arc-second (approximately 30m).

This dataset has undergone a void-filling process using open-source data\n(ASTER GDEM2, GMTED2010, and NED), as opposed to other versions that\ncontain voids or have been void-filled with commercial sources.\nFor more information on the different versions see the\n<a href=\"https://lpdaac.usgs.gov/documents/13/SRTM_Quick_Guide.pdf\">SRTM Quick Guide.

Documentation:

Provider: <a href=\"https://cmr.earthdata.nasa.gov/search/concepts/C1000000240-LPDAAC_ECS.html\">NASA / USGS / JPL-Caltech

Bands<table class=\"eecat\"><th scope=\"col\">Name<th scope=\"col\">Descriptionelevation

Elevation

Terms of Use

Unless otherwise noted, images and video on JPL public\nweb sites (public sites ending with a jpl.nasa.gov address) may\nbe used for any purpose without prior permission. For more information\nand exceptions visit the <a href=\"https://www.jpl.nasa.gov/imagepolicy/\">JPL Image Use Policy site.

Suggested citation(s)

"

$properties$source_tags [1] "nasa" "usgs"

$properties$visualization_0_max [1] "6000.0"

$properties$title [1] "NASA SRTM Digital Elevation 30m"

$properties$product_tags [1] "srtm" "elevation" "topography" "dem" "geophysical"

$properties$provider [1] "NASA / USGS / JPL-Caltech"

$properties$visualization_0_min [1] "0.0"

$properties$visualization_0_name [1] "Elevation"

$properties$date_range [1] -1 -1

$properties$system:visualization_0_gamma [1] "1.6"

$properties$period [1] 0

$properties$system:visualization_0_bands [1] "elevation"

$properties$provider_url [1] "https://cmr.earthdata.nasa.gov/search/concepts/C1000000240-LPDAAC_ECS.html"

$properties$visualization_0_gamma [1] "1.6"

$properties$sample [1] "https://mw1.google.com/ges/dd/images/SRTM90_V4_sample.png"

$properties$tags [1] "dem" "elevation" "geophysical" "nasa" "srtm" "topography" [7] "usgs"

$properties$system:visualization_0_max [1] "6000.0"

$properties$system:visualization_0_name [1] "Elevation"

$properties$system:asset_size [1] -1

$properties$visualization_0_bands [1] "elevation" Attach your Python (reticulate) configuration:

library(reticulate)
py_config()

python: D:/miniconda3/envs/geocompy/python.exe libpython: D:/miniconda3/envs/geocompy/python39.dll pythonhome: D:/miniconda3/envs/geocompy version: 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:28:38) [MSC v.1929 64 bit (AMD64)] Architecture: 64bit numpy: D:/miniconda3/envs/geocompy/Lib/site-packages/numpy numpy_version: 1.23.5 ee: D:\miniconda3\envs\geocompy\lib\site-packages\ee__init__.p

NOTE: Python version was forced by use_python function

Description

Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

What I Did

When i have finished the 'ee_Initialize()' and run'ee_check()' ,it raise an error that gcloud failed

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

ee_check() ◉ Python version ✔ [Ok] D:/miniconda3/envs/geocompy/python.exe v3.9 ◉ Python packages: ✔ [Ok] numpy ✔ [Ok] earthengine-api NOTE: The Earth Engine Python API version 0.1.342 is installed correctly in the system but rgee was tested using the version 0.1.343. To avoid possible issues, we recommend install the version used by rgee (0.1.343). You might use:

  • rgee::ee_install_upgrade()
  • reticulate::py_install('earthengine-api==0.1.343', envname='PUT_HERE_YOUR_PYENV')
  • pip install earthengine-api==0.1.343 (Linux and Mac0S)
  • conda install earthengine-api==0.1.343 (Linux, Mac0S, and Windows)

ϵͳ�Ҳ���ָ����·���� Error in ee_check_gcloud() : gcloud failed [os.system('gcloud --help')]. Please check for any errors above and install gcloud if needed (https://cloud.google.com/sdk/docs/install). image

csaybar commented 1 year ago

Hi @SpatLyu

Sorry from rgee v1.1.6, we decided to use 'auth_mode = "notebook"' by default. Therefore, gcloud is no longer required. This issue was fixed in the last release please run again to fix:

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