无法从 ipython 笔记本安装 'rstats-db/bigrquery'

Unable to install 'rstats-db/bigrquery' from ipython notebook

我正在尝试从 R iPython 笔记本查询 Google Big Query。我正在关注此 post 此处:

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/bigrquery@master
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

从你的回溯中很难说出发生了什么。但是您可以尝试使用官方版本而不是开发版本。

尝试改用此命令:

install.packages("bigrquery")

正如您在 official release, support for useLegacySQL has already been implemented 中看到的那样。