gpt4 book ai didi

R 包 - 为什么 tidyr 安装依赖项列表中未定义的依赖项?

转载 作者:行者123 更新时间:2023-12-02 18:18:45 26 4
gpt4 key购买 nike

为了节省时间,我想创建一个预装 R 库的 docker 镜像。 -> 节省大量时间
Dockerfile的一部分看起来像这样

RUN Rscript -e 'require(devtools); devtools::install_version("dplyr", version="0.5.0", repos = "http://cran.rstudio.com/")'
RUN Rscript -e 'library(dplyr); sessionInfo()'
RUN Rscript -e 'require(devtools); devtools::install_version("ggplot2", version="2.2.1", repos = "http://cran.rstudio.com/")'
RUN Rscript -e 'library(dplyr); sessionInfo()'
RUN Rscript -e 'require(devtools); devtools::install_version("knitr", version="1.15.1", repos = "http://cran.rstudio.com/")'
RUN Rscript -e 'library(dplyr); sessionInfo()'
RUN Rscript -e 'require(devtools); devtools::install_version("tidyr", version="0.6.0", repos = "http://cran.rstudio.com/")

由于这是一个生产环境,我不希望有任何惊喜。因此,我想每次都安装相同版本的软件包,因此您可以在上面看到特定版本。

现在我的问题 :如果我们查看 tidyr 包(v0.6.0)的说明文件:
https://github.com/tidyverse/tidyr/blob/v0.6.0/DESCRIPTION

它说:
Imports:
tibble,
dplyr (>= 0.4),
stringi,
lazyeval,
magrittr,
Rcpp

在我的系统中,我已经预装了 dplyr 0.5.0,所以这不会触发更新。

这是我的 docker 输出(请注意,我添加了 sessionInfo() 语句来显示安装的 dplyr 版本),如您所见,系统上安装了 dplyr 0.5.0,然后 tidyr 版本 0.6.0 强制安装 dplyr、tidyselect 和plogr。
Step 56/103 : RUN Rscript -e 'library(dplyr); sessionInfo()'
---> Running in 587c27a05216

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

filter, lag

The following objects are masked from 'package:base':

intersect, setdiff, setequal, union

Warning message:
As of rlang 0.4.0, dplyr must be at least version 0.8.0.
x dplyr 0.5.0 is too old for rlang 0.4.2.
i Please update dplyr with `install.packages("dplyr")`.
R version 3.2.5 (2016-04-14)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

locale:
[1] C

attached base packages:
[1] stats graphics grDevices utils datasets base

other attached packages:
[1] dplyr_0.5.0

loaded via a namespace (and not attached):
[1] magrittr_1.5 R6_2.4.1 assertthat_0.2.1 cli_2.0.0
[5] tools_3.2.5 DBI_1.1.0 pillar_1.4.3 glue_1.3.1
[9] tibble_2.1.3 crayon_1.3.4 Rcpp_1.0.3 fansi_0.4.0
[13] methods_3.2.5 pkgconfig_2.0.3 rlang_0.4.2
---> e55ec5828abb
Removing intermediate container 587c27a05216
Step 57/103 : RUN Rscript -e 'require(devtools); devtools::install_version("tidyr", version="0.6.0", repos = "http://cran.rstudio.com/")'
---> Running in 09ada6215edb
Loading required package: devtools
Loading required package: usethis
Downloading package from url: http://cran.rstudio.com//src/contrib/Archive/tidyr/tidyr_0.6.0.tar.gz
dplyr (0.5.0 -> 0.8.3) [CRAN]
tidyselect (NA -> 0.2.5) [CRAN]
plogr (NA -> 0.2.0) [CRAN]
Installing 3 packages: dplyr, tidyselect, plogr
Installing packages into '/usr/local/r-libs'
(as 'lib' is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/dplyr_0.8.3.tar.gz'
Content type 'application/x-gzip' length 1173098 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'http://cran.rstudio.com/src/contrib/tidyselect_0.2.5.tar.gz'
Content type 'application/x-gzip' length 21883 bytes (21 KB)
==================================================
downloaded 21 KB

trying URL 'http://cran.rstudio.com/src/contrib/plogr_0.2.0.tar.gz'
Content type 'application/x-gzip' length 7795 bytes
==================================================
downloaded 7795 bytes

* installing *source* package 'tidyselect' ...
** package 'tidyselect' successfully unpacked and MD5 sums checked
** libs
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I/usr/local/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c RcppExports.cpp -o RcppExports.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I/usr/local/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c combine_variables.cpp -o combine_variables.o
g++ -shared -L/usr/local/lib64 -o tidyselect.so RcppExports.o combine_variables.o
installing to /usr/local/r-libs/tidyselect/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (tidyselect)
* installing *source* package 'plogr' ...
** package 'plogr' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (plogr)
* installing *source* package 'dplyr' ...
** package 'dplyr' successfully unpacked and MD5 sums checked
** libs
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c RcppExports.cpp -o RcppExports.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c address.cpp -o address.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c api.cpp -o api.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c arrange.cpp -o arrange.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c between.cpp -o between.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c bind.cpp -o bind.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c distinct.cpp -o distinct.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c encoding.cpp -o encoding.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c filter.cpp -o filter.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c group_indices.cpp -o group_indices.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c hybrid.cpp -o hybrid.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c init.cpp -o init.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c join.cpp -o join.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c join_exports.cpp -o join_exports.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c mutate.cpp -o mutate.o
gcc -std=gnu99 -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -c rlang-export.c -o rlang-export.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c rlang.cpp -o rlang.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c select.cpp -o select.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c set.cpp -o set.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c summarise.cpp -o summarise.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c test.cpp -o test.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c utils-bindings.cpp -o utils-bindings.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c utils.cpp -o utils.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I/usr/local/include -I"/usr/local/r-libs/BH/include" -I"/usr/local/r-libs/plogr/include" -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c window.cpp -o window.o
g++ -shared -L/usr/local/lib64 -o dplyr.so RcppExports.o address.o api.o arrange.o between.o bind.o distinct.o encoding.o filter.o group_indices.o hybrid.o init.o join.o join_exports.o mutate.o rlang-export.o rlang.o select.o set.o summarise.o test.o utils-bindings.o utils.o window.o
installing to /usr/local/r-libs/dplyr/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (dplyr)

The downloaded source packages are in
'/tmp/Rtmp3DsAO3/downloaded_packages'
Installing package into '/usr/local/r-libs'
(as 'lib' is unspecified)
* installing *source* package 'tidyr' ...
** package 'tidyr' successfully unpacked and MD5 sums checked
** libs
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I/usr/local/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c RcppExports.cpp -o RcppExports.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I/usr/local/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c fill.cpp -o fill.o
g++ -I/my-software/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c melt.cpp -o melt.o
g++ -I/my-software/usr/local/bin/lib64/R/include -DNDEBUG -I/usr/local/include -I"/usr/local/r-libs/Rcpp/include" -fpic -O3 -std=gnu++0x -c simplifyPieces.cpp -o simplifyPieces.o
g++ -shared -L/usr/local/lib64 -o tidyr.so RcppExports.o fill.o melt.o simplifyPieces.o
installing to /usr/local/r-libs/tidyr/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tidyr)
---> 6e55e42fb917
Removing intermediate container 09ada6215edb
Step 58/103 : RUN Rscript -e 'library(dplyr); sessionInfo()'
---> Running in c917b6912a89

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

filter, lag

The following objects are masked from 'package:base':

intersect, setdiff, setequal, union

R version 3.2.5 (2016-04-14)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

locale:
[1] C

attached base packages:
[1] stats graphics grDevices utils datasets base

other attached packages:
[1] dplyr_0.8.3

loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 magrittr_1.5 assertthat_0.2.1 R6_2.4.1
[5] pillar_1.4.3 glue_1.3.1 tibble_2.1.3 crayon_1.3.4
[9] Rcpp_1.0.3 methods_3.2.5 pkgconfig_2.0.3 rlang_0.4.2
[13] purrr_0.3.3
---> b4f3949d3bf8
Removing intermediate container c917b6912a89


重要的一点是:
Downloading package from url: http://cran.rstudio.com//src/contrib/Archive/tidyr/tidyr_0.6.0.tar.gz
dplyr (0.5.0 -> 0.8.3) [CRAN]

R 在哪里找到这些依赖项,因为它们不在描述文件中(并且 dplyr v0.4.0 >= 已经满足)?

最佳答案

你的部分输出告诉你答案

As of rlang 0.4.0, dplyr must be at least version 0.8.0.

如果你想使用 rlang 0.4.0,你至少需要有 dplyr 0.8.0。

边注

请使用较少的 docker 层,特别是如果此镜像将用于生产。或者在最后压扁层。

构建图像时有一个标志要压扁。它记录在这里
  • https://docs.docker.com/engine/reference/commandline/image_build/

  • 它的要点
    docker image build --squash -t myimage:mytag .

    为了兼容各种基础设施设置,我建议不要超过 42 个图像层。这里是关于 42 层声明的起源:

    https://stackoverflow.com/a/39383801/12153397

    关于R 包 - 为什么 tidyr 安装依赖项列表中未定义的依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59424664/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com