2017-07-25 65 views
0

我試圖從R iPython筆記本查詢Google Big Query。我在這裏以下這篇文章:無法從ipython筆記本安裝'rstats-db/bigrquery'

https://cloud.google.com/blog/big-data/2017/04/google-cloud-platform-for-data-scientists-using-r-with-google-bigquery

它打破了,當我跑這條線:

devtools::install_github("rstats-db/bigrquery", force = TRUE) 

完整的錯誤消息對我來說並不很清楚,我將在下面粘貼。但是當我從交互式R環境中運行它時,我得到:

sh: /usr/bin/gnutar: No such file or directory 
sh: /usr/bin/gnutar: No such file or directory 
Installation failed: error in running command 
trying URL 'https://cran.rstudio.com/src/contrib/readr_1.1.1.tar.gz' 
Content type 'application/x-gzip' length 233793 bytes (228 KB) 
================================================== 
downloaded 228 KB 

它似乎無法解壓文件。

我試過用brew來安裝gnutar,但它仍然出現錯誤。

我怎樣才能通過這個錯誤?

完整的錯誤信息:

Installing package into ‘/Users/user/Library/R/3.3/library’ 
(as ‘lib’ is unspecified) 
Downloading GitHub repo rstats-db/[email protected] 
from URL https://api.github.com/repos/rstats-db/bigrquery/zipball/master 
Installing bigrquery 
Warning message in utils::untar(src, exdir = target, compressed = "gzip"): 
「‘/usr/bin/gnutar -xf '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/assertthat_0.2.0.tar.gz' -C '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/devtoolsb8f71357947'’ returned error code 127」Installation failed: error in running command 
Warning message in utils::untar(src, exdir = target, compressed = "gzip"): 
「‘/usr/bin/gnutar -xf '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/DBI_0.7.tar.gz' -C '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/devtoolsb8f4d592385'’ returned error code 127」Installation failed: error in running command 
Warning message in utils::untar(src, exdir = target, compressed = "gzip"): 
「‘/usr/bin/gnutar -xf '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/jsonlite_1.5.tar.gz' -C '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/devtoolsb8f40b600f1'’ returned error code 127」Installation failed: error in running command 
Warning message in utils::untar(src, exdir = target, compressed = "gzip"): 
「‘/usr/bin/gnutar -xf '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/readr_1.1.1.tar.gz' -C '/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T//RtmpvuCFsS/devtoolsb8f2bae1fe6'’ returned error code 127」Installation failed: error in running command 
'/Applications/anaconda/lib/R/bin/R' --no-site-file --no-environ --no-save \ 
    --no-restore --quiet CMD INSTALL \ 
    '/private/var/folders/bx/t0zshghn4d97zrt6qfplsx0ngq83z6/T/RtmpvuCFsS/devtoolsb8f2945f879/rstats-db-bigrquery-ad77f0e' \ 
    --library='/Users/nickk/Library/R/3.3/library' --install-tests 

Reloading installed bigrquery 

回答

0

從您的回溯這很難說發生了什麼。但是你可以嘗試使用官方版本而不是開發版本。

嘗試使用這個命令:

install.packages("bigrquery") 

正如你可以在official releaseuseLegacySQL支持已經被implemented

+0

哦,我明白了 - 我似乎善於錯誤診斷事物。你能告訴我是否可以使用標準的SQL?我似乎無法獲得standardSQL查詢的工作。 – goose

+0

它應該與您在後的帖子完全相同,例如:'todo_copies < - query_exec(sql,project = project,useLegacySql = FALSE)'。你嘗試使用'useLegacySql = False'嗎?它沒有工作? –

+0

不,不是。我已經發布這個問題,因爲你指出它應該工作: https://stackoverflow.com/questions/45331678/unable-to-use-bigrquery-with-standard-sql – goose