【发布时间】:2021-05-06 15:13:45
【问题描述】:
我是 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
【问题讨论】:
-
希望这个帖子可以帮到你。 github.com/tidyverse/googledrive/issues/276
-
错误仍然存在。 :'(
drive_auth(use_oob = TRUE)>token_fetch()捕获的错误: > 无法连接到 accounts.google.com 端口 443: 超时和更多相同的错误消息。
标签: r google-drive-api credentials google-earth-engine gargle