0

我是 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
4

1 回答 1

0

经过多次尝试,我解决了无法打开浏览器删除并重新安装 Rcpp 包(版本 1.0.7)的问题,现在一切正常

于 2021-12-29T22:44:12.560 回答