软件包的安装状态出现非零值

12
我刚刚更新了R到版本3.6.2,即去年12月12日发布的“黑暗和风雨之夜”。我尝试安装以下软件包,但收到相同的错误:“安装X软件包时出现非零退出状态”。
这些软件包包括:broom,tidyr,tidyselect,vctrs和rlang。
我已经检查了broom的文档,没有发现任何明确说明它仅受支持于先前某些版本的内容。为了提供背景,今天下午我使用的是5.2.1版本,遇到了类似的错误并决定升级。
问题可能是出在我这里吗,我的mac OSX Catalina?我该怎么解决这个问题?
以下是请求的更多错误信息:
> library("tidyverse", lib.loc="/Library/Frameworks/R.framework/Versions/3.6/Resources/library")
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘broom’


编辑2:根据评论的要求,所有错误和信息的详尽打印输出:
> install.packages("tidyverse")
also installing the dependencies ‘colorspace’, ‘sys’, ‘ps’, ‘highr’, ‘markdown’, ‘farver’, ‘labeling’, ‘munsell’, ‘RColorBrewer’, ‘askpass’, ‘rematch’, ‘prettyunits’, ‘processx’, ‘knitr’, ‘yaml’, ‘htmltools’, ‘evaluate’, ‘base64enc’, ‘tinytex’, ‘xfun’, ‘DBI’, ‘tidyselect’, ‘gtable’, ‘lazyeval’, ‘scales’, ‘viridisLite’, ‘withr’, ‘vctrs’, ‘curl’, ‘mime’, ‘openssl’, ‘clipr’, ‘cellranger’, ‘progress’, ‘callr’, ‘fs’, ‘rmarkdown’, ‘whisker’, ‘selectr’, ‘broom’, ‘dbplyr’, ‘forcats’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘jsonlite’, ‘lubridate’, ‘modelr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rstudioapi’, ‘rvest’, ‘tidyr’, ‘xml2’


  There are binary versions available but the source versions are later:
            binary source needs_compilation
prettyunits  1.1.0  1.1.1             FALSE
tidyselect   0.2.5  1.0.0              TRUE
vctrs        0.2.1  0.2.2              TRUE
callr        3.4.0  3.4.1             FALSE
broom        0.5.3  0.5.4             FALSE
rlang        0.4.2  0.4.3              TRUE
tidyr        1.0.0  1.0.2              TRUE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) yes
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/colorspace_1.4-1.tgz'
Content type 'application/x-gzip' length 2522321 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/sys_3.3.tgz'
Content type 'application/x-gzip' length 47231 bytes (46 KB)
==================================================
downloaded 46 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/ps_1.3.0.tgz'
Content type 'application/x-gzip' length 209460 bytes (204 KB)
==================================================
downloaded 204 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/highr_0.8.tgz'
Content type 'application/x-gzip' length 41180 bytes (40 KB)
==================================================
downloaded 40 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/markdown_1.1.tgz'
Content type 'application/x-gzip' length 199930 bytes (195 KB)
==================================================
downloaded 195 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/farver_2.0.3.tgz'
Content type 'application/x-gzip' length 1828397 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/labeling_0.3.tgz'
Content type 'application/x-gzip' length 61520 bytes (60 KB)
==================================================
downloaded 60 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/munsell_0.5.0.tgz'
Content type 'application/x-gzip' length 243642 bytes (237 KB)
==================================================
downloaded 237 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/RColorBrewer_1.1-2.tgz'
Content type 'application/x-gzip' length 53161 bytes (51 KB)
==================================================
downloaded 51 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/askpass_1.1.tgz'
Content type 'application/x-gzip' length 21926 bytes (21 KB)
==================================================
downloaded 21 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/rematch_1.0.1.tgz'
Content type 'application/x-gzip' length 12480 bytes (12 KB)
==================================================
downloaded 12 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/processx_3.4.1.tgz'
Content type 'application/x-gzip' length 236878 bytes (231 KB)
==================================================
downloaded 231 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/knitr_1.27.tgz'
Content type 'application/x-gzip' length 1380627 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/yaml_2.2.0.tgz'
Content type 'application/x-gzip' length 201073 bytes (196 KB)
==================================================
downloaded 196 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/htmltools_0.4.0.tgz'
Content type 'application/x-gzip' length 342242 bytes (334 KB)
==================================================
downloaded 334 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/evaluate_0.14.tgz'
Content type 'application/x-gzip' length 74657 bytes (72 KB)
==================================================
downloaded 72 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/base64enc_0.1-3.tgz'
Content type 'application/x-gzip' length 32230 bytes (31 KB)
==================================================
downloaded 31 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/tinytex_0.19.tgz'
Content type 'application/x-gzip' length 98971 bytes (96 KB)
==================================================
downloaded 96 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/xfun_0.12.tgz'
Content type 'application/x-gzip' length 178520 bytes (174 KB)
==================================================
downloaded 174 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/DBI_1.1.0.tgz'
Content type 'application/x-gzip' length 586234 bytes (572 KB)
==================================================
downloaded 572 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/gtable_0.3.0.tgz'
Content type 'application/x-gzip' length 432473 bytes (422 KB)
==================================================
downloaded 422 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/lazyeval_0.2.2.tgz'
Content type 'application/x-gzip' length 158838 bytes (155 KB)
==================================================
downloaded 155 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/scales_1.1.0.tgz'
Content type 'application/x-gzip' length 544693 bytes (531 KB)
==================================================
downloaded 531 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/viridisLite_0.3.0.tgz'
Content type 'application/x-gzip' length 57231 bytes (55 KB)
==================================================
downloaded 55 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/withr_2.1.2.tgz'
Content type 'application/x-gzip' length 152438 bytes (148 KB)
==================================================
downloaded 148 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/curl_4.3.tgz'
Content type 'application/x-gzip' length 741337 bytes (723 KB)
==================================================
downloaded 723 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/mime_0.8.tgz'
Content type 'application/x-gzip' length 35364 bytes (34 KB)
==================================================
downloaded 34 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/openssl_1.4.1.tgz'
Content type 'application/x-gzip' length 2690137 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/clipr_0.7.0.tgz'
Content type 'application/x-gzip' length 48251 bytes (47 KB)
==================================================
downloaded 47 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/cellranger_1.1.0.tgz'
Content type 'application/x-gzip' length 103127 bytes (100 KB)
==================================================
downloaded 100 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/progress_1.2.2.tgz'
Content type 'application/x-gzip' length 82991 bytes (81 KB)
==================================================
downloaded 81 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/fs_1.3.1.tgz'
Content type 'application/x-gzip' length 852880 bytes (832 KB)
==================================================
downloaded 832 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/rmarkdown_2.1.tgz'
Content type 'application/x-gzip' length 3556971 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/whisker_0.4.tgz'
Content type 'application/x-gzip' length 65424 bytes (63 KB)
==================================================
downloaded 63 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/selectr_0.4-2.tgz'
Content type 'application/x-gzip' length 490483 bytes (478 KB)
==================================================
downloaded 478 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/dbplyr_1.4.2.tgz'
Content type 'application/x-gzip' length 578881 bytes (565 KB)
==================================================
downloaded 565 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/forcats_0.4.0.tgz'
Content type 'application/x-gzip' length 343715 bytes (335 KB)
==================================================
downloaded 335 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/ggplot2_3.2.1.tgz'
Content type 'application/x-gzip' length 3973186 bytes (3.8 MB)
==================================================
downloaded 3.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/haven_2.2.0.tgz'
Content type 'application/x-gzip' length 1077133 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/hms_0.5.3.tgz'
Content type 'application/x-gzip' length 103612 bytes (101 KB)
==================================================
downloaded 101 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/httr_1.4.1.tgz'
Content type 'application/x-gzip' length 492648 bytes (481 KB)
==================================================
downloaded 481 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/jsonlite_1.6.tgz'
Content type 'application/x-gzip' length 1117755 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/lubridate_1.7.4.tgz'
Content type 'application/x-gzip' length 1512972 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/modelr_0.1.5.tgz'
Content type 'application/x-gzip' length 199606 bytes (194 KB)
==================================================
downloaded 194 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/readr_1.3.1.tgz'
Content type 'application/x-gzip' length 792657 bytes (774 KB)
==================================================
downloaded 774 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/readxl_1.3.1.tgz'
Content type 'application/x-gzip' length 1646895 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/reprex_0.3.0.tgz'
Content type 'application/x-gzip' length 424791 bytes (414 KB)
==================================================
downloaded 414 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/rstudioapi_0.10.tgz'
Content type 'application/x-gzip' length 214537 bytes (209 KB)
==================================================
downloaded 209 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/rvest_0.3.5.tgz'
Content type 'application/x-gzip' length 662160 bytes (646 KB)
==================================================
downloaded 646 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/xml2_1.2.2.tgz'
Content type 'application/x-gzip' length 1102370 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 433010 bytes (422 KB)
==================================================
downloaded 422 KB


The downloaded binary packages are in
    /var/folders/rb/qs7xx8rs633bk4njyk_6t7bh0000gn/T//RtmphOGt7Z/downloaded_packages
installing the source packages ‘prettyunits’, ‘tidyselect’, ‘vctrs’, ‘callr’, ‘broom’, ‘rlang’, ‘tidyr’

trying URL 'https://cran.rstudio.com/src/contrib/prettyunits_1.1.1.tar.gz'
Content type 'application/x-gzip' length 10366 bytes (10 KB)
==================================================
downloaded 10 KB

trying URL 'https://cran.rstudio.com/src/contrib/tidyselect_1.0.0.tar.gz'
Content type 'application/x-gzip' length 151161 bytes (147 KB)
==================================================
downloaded 147 KB

trying URL 'https://cran.rstudio.com/src/contrib/vctrs_0.2.2.tar.gz'
Content type 'application/x-gzip' length 721926 bytes (705 KB)
==================================================
downloaded 705 KB

trying URL 'https://cran.rstudio.com/src/contrib/callr_3.4.1.tar.gz'
Content type 'application/x-gzip' length 67676 bytes (66 KB)
==================================================
downloaded 66 KB

trying URL 'https://cran.rstudio.com/src/contrib/broom_0.5.4.tar.gz'
Content type 'application/x-gzip' length 1228129 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.4.3.tar.gz'
Content type 'application/x-gzip' length 813395 bytes (794 KB)
==================================================
downloaded 794 KB

trying URL 'https://cran.rstudio.com/src/contrib/tidyr_1.0.2.tar.gz'
Content type 'application/x-gzip' length 812005 bytes (792 KB)
==================================================
downloaded 792 KB

* installing *source* package ‘prettyunits’ ...
** package ‘prettyunits’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (prettyunits)
* installing *source* package ‘callr’ ...
** package ‘callr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (callr)
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** using staged installation
** libs


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.


ERROR: compilation failed for package ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
ERROR: dependency ‘rlang’ is not available for package ‘vctrs’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/vctrs’
Warning in install.packages :
  installation of package ‘vctrs’ had non-zero exit status
ERROR: dependencies ‘rlang’, ‘vctrs’ are not available for package ‘tidyselect’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tidyselect’
Warning in install.packages :
  installation of package ‘tidyselect’ had non-zero exit status
ERROR: dependencies ‘rlang’, ‘tidyselect’, ‘vctrs’ are not available for package ‘tidyr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tidyr’
Warning in install.packages :
  installation of package ‘tidyr’ had non-zero exit status
ERROR: dependency ‘tidyr’ is not available for package ‘broom’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/broom’
Warning in install.packages :
  installation of package ‘broom’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/rb/qs7xx8rs633bk4njyk_6t7bh0000gn/T/RtmphOGt7Z/downloaded_packages’

1
R版本不是问题 - 我已经在3.6.2下安装了所有这些软件包。您需要从错误消息中提供更多详细信息。通常,“非零退出状态”上面的行指示出了出了什么问题。 - neilfws
1
这个错误只是告诉你broom没有安装。当你尝试安装它时,会出现什么样的消息? - neilfws
请点击这里查看我的解决方案。希望对你有所帮助。 - undefined
3个回答

15
当你调用install.packages("broom")(或插入包)时,你会收到以下消息: Do you want to install from sources the packages which need compilation? (Yes/no/cancel) 你回答了yes
尝试回答no并比较结果。这应该可以解决问题。

12
我也遇到了同样的问题。选择“否”有所不同。这是怎么回事? - acircleda
2
这似乎对kableExtra无效。还有其他解决方案吗? - mpour

0

真是不可思议,我解决的办法竟然是重新启动 R 并再次尝试。


0
我曾经在使用其他软件包时遇到过这个问题。我的解决方案是阅读列为红色并标有问题(例如“无法安装”)的依赖软件包的输出。在RStudio中,转到“Packages”选项卡,并删除所有引发所需更新中“红旗”的软件包(单击x)。重新启动RStudio,然后重新安装主要软件包,允许其通过依赖项更新运行。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接