使用谷歌驱动器凭据和谷歌地球引擎在 RStudio 中出错

问题描述

我是 R 编程的新手,正在尝试执行 R 代码,我可以在其中访问谷歌驱动器和谷歌地球引擎。然而,有两种情况正在发生:首先是在我家里的个人笔记本电脑上运行代码,它运行良好,甚至没有打开浏览器来请求访问权限。 而在第二种情况下,当我使用远程桌面连接并访问公司的计算机时,代码无法获取谷歌凭据。

可能是什么?它与远程访问或软件包版本有关吗?如下数据:.

在我的个人笔记本电脑中:

> ## Initialize GEE ----
> ee_Initialize(email = gee_email,drive = TRUE)
-- rgee 1.0.9 ------------------------------------------------------------ earthengine-api 0.1.248 --
 √ email: my.email@colaborator.company.br 
 √ Google Drive credentials:  FOUND
 √ Initializing Google Earth Engine:  DONE!
 √ Earth Engine user: users/rcode
-----------------------------------------------------------------------------------------------------

通过远程桌面连接在公司电脑中的相同代码

> ## Initialize GEE ----
> ee_Initialize(email = gee_email,drive = TRUE)
-- rgee 1.0.9 ------------------------------------------------------------------------------- earthengine-api 0.1.263 -- 
 √ email: my.email@colaborator.company.br 
 √ Google Drive credentials:Erro: Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.
  * Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html

执行命令后:

选项(gargle_quiet = FALSE)

googledrive::drive_auth("my.email@colaborator.company.br")

> trying `token_fetch()`
> trying `credentials_service_account()`
> Error caught by `token_fetch()`:
  Argument 'txt' must be a JSON string,URL or file.
> trying `credentials_app_default()`
> trying `credentials_gce()`
> trying `credentials_byo_oauth()`
> Error caught by `token_fetch()`:
  inherits(token,"Token2.0") is not TRUE
> trying `credentials_user_oauth2()`
> Gargle2.0 initialize
> attempt to access internal gargle data from: googledrive
> adding 'userinfo.email' scope
> loading token from the cache
> no matching token in the cache
> initiating new token
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
> Error caught by `token_fetch()`:
  Failed to connect to accounts.google.com port 443: Timed out
Erro: Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.
  * Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)