rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

Cannot Install Packages #194

Closed spsanderson closed 4 years ago

spsanderson commented 4 years ago

I am getting an error trying to install a package from CRAN that requires R >= 3.1.0

I am using the following image: sha256:ee12b86c83a21c22ace8d4c9cceaabdbf5a9cbec6dd7486399d7b5e170568947

I am running R on Ubuntu Server 18.04LTS with the latest updates as of today 3-1-2020. I am running R and R-Studio as a docker container via the rocker-org project with tag 3.5.3 on the tidyverse image.

> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] usethis_1.5.0  devtools_2.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        rstudioapi_0.10   magrittr_1.5      pkgload_1.0.2    
 [5] lattice_0.20-38   R6_2.4.0          rlang_0.3.4       tools_3.5.3      
 [9] grid_3.5.3        pkgbuild_1.0.3    sessioninfo_1.1.1 cli_1.1.0        
[13] withr_2.1.2       remotes_2.0.4     assertthat_0.2.1  digest_0.6.18    
[17] rprojroot_1.3-2   crayon_1.3.4      Matrix_1.2-15     processx_3.3.0   
[21] callr_3.2.0       fs_1.2.7          arules_1.6-3      ps_1.3.0         
[25] rsconnect_0.8.13  curl_3.3          testthat_2.1.1    memoise_1.1.0    
[29] glue_1.3.1        compiler_3.5.3    desc_1.2.0        backports_1.1.4  
[33] prettyunits_1.0.2 jsonlite_1.6 

I tried from both CRAN and github

CRAN

install.packages("mlr3")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘mlr3’ is not available (for R version 3.5.3)

GitHub

remotes::install_github("mlr-org/mlr3")
Downloading GitHub repo mlr-org/mlr3@master
Skipping 3 packages not available: mlr3measures, mlr3misc, paradox
Installing 5 packages: lgr, mlbench, mlr3measures, mlr3misc, paradox
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Error: (converted from warning) packages ‘mlr3measures’, ‘mlr3misc’, ‘paradox’ are not available (for R version 3.5.3)
eddelbuettel commented 4 years ago
  1. What container of ours are you actually running? You don't say, or if you do I missed in all the other information thrown out here. And no, tje sha1 sum does not help. We publish about two dozen container images, so being more specific helps everybody.

  2. Are you aware that CRAN puts out packages to be installable for the current R version. So if you were to run, say, rocker/r-base which is already at R 3.6.3, then of course mlr3 would be installable.

Reproducible example (where I launch into bash and use install.r for personal preference)

edd@rob:~$ docker run --rm -ti rocker/r-base bash
root@40c126936056:/# install.r mlr3
also installing the dependencies ‘R6’, ‘backports’, ‘checkmate’, ‘data.table’, ‘digest’, ‘lgr’, ‘mlbench’, ‘mlr3measures’, ‘mlr3misc’, ‘paradox’, ‘uuid’

[... lots of output omitted ... ]

So mlr3 is clearly there for the normal bread-and-butter container. If you use a different one, presumably r-ver (which version though?) you need to check that the package was installable when the snapshot was made. r-ver gives you a "time machine". That can be a constraint too.

cboettig commented 4 years ago

Remember that the rocker versioned stack locks all packages to the last date said version of R was current by default. If you really want to stick with 3.5.3 but still install packages that were first published after it was no longer current (see ), you should override the default version-locked mirror with a normal CRAN mirror (e.g. options(repos = "https://cran.rstudio.com"))

Otherwise, I strongly suggest you consider running a more recent version of R, e.g. rocker/tidyverse:3.6.2 (or simply rocker/tidyverse:latest) where your above command should work fine. (yes, 3.6.3 was just released and latest will move to that soon)!

eddelbuettel commented 4 years ago

Yep, @cboettig and I basically told you the exact same thing at the same time. Basing this on R 3.5.2 from a year ago may not be the best bet if you want packages from now. I like rocker/r-base myself.

eddelbuettel commented 4 years ago

(Also just to pick nits: if the desire is mlr3 then tidyverse does little for you as there is close to no overlap.)

spsanderson commented 4 years ago

@cboettig Ahhhhh ok, I was thinking something like that, that packages were only good at the time of the version, thank you.

@eddelbuettel I use tidyverse for so many projects and mlr for one specific but thank you

eddelbuettel commented 4 years ago

No sweat or worries. In that case take the tidyverse container as a base, but remain cogniscient of the "contract" you signed with a versioned container: "stability to the release point in time first", even at the expense of installability. A feature you chose and opted for, and not a bug ;-)

spsanderson commented 4 years ago

Totally understand now hence the close thank you much, loving the container so far just getting the feel for it sorry for the erroneous bug report.

eddelbuettel commented 4 years ago

It's not easy as there is 'so much'. Maybe look the R Journal piece, it defines a few things.

nturaga commented 4 years ago

Remember that the rocker versioned stack locks all packages to the last date said version of R was current by default. If you really want to stick with 3.5.3 but still install packages that were first published after it was no longer current (see ), you should override the default version-locked mirror with a normal CRAN mirror (e.g. options(repos = "https://cran.rstudio.com"))

Otherwise, I strongly suggest you consider running a more recent version of R, e.g. rocker/tidyverse:3.6.2 (or simply rocker/tidyverse:latest) where your above command should work fine. (yes, 3.6.3 was just released and latest will move to that soon)!

Any update on R 3.6.3 @cboettig ?

cboettig commented 4 years ago

@nturaga whoops, missed this ping. Yes, we moved up to 3.6.3 a little while ago.