我刚开始在R中编程,我正在尝试执行一个R代码,在这里我可以访问google驱动器和google引擎。然而,有两种情况正在发生:第一,在我的个人笔记本电脑上,我运行代码,它运行得很完美,甚至没有打开浏览器来请求访问权限。在第二种情况下,当我使用远程桌面连接并访问公司的计算机时,代码无法获得google凭据。
会是什么?它是与远程访问有关还是与包版本有关?以下数据如下:
在我的笔记本电脑里:
> ## 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执行命令之后:
googledrive::drive_auth("my.email@colaborator.company.br")
选项(gargle_quiet= FALSE)
> 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发布于 2021-12-29 22:44:12
经过多次尝试,我修复了不打开浏览器、删除和重新安装Rcpp包的问题(ver )。(现在一切都很完美
https://stackoverflow.com/questions/67421031
复制相似问题