rstudio / renv

renv: Project environments for R.
https://rstudio.github.io/renv/
MIT License
1k stars 152 forks source link

System libraries loaded via namespace? #1671

Closed christianwoe closed 9 months ago

christianwoe commented 1 year ago

Dear all,

I recently started to having problems that sometimes older packages are loaded when opening projects with renv in RStudio and having a Rmd scipt open. The library version used may be versions from the underlying system. Restarting the R session helps, but not always in the first attempt. Closing the script open in the editor before opening seems to fix this as well, but only temporary it seems.

I just updated to renv 1.0.2 and did not observe this before. Maybe something broke while updating?

Here is an example of the error when I try to load tidyverse in such a project:

> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: NULL
  error: package or namespace load failed for ‘tidyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘cli’ 3.6.0 is already loaded, but >= 3.6.1 is require

In the renv library version 3.6.1 is installed, but the underlying system has version 3.6.0, which seems to be loaded in such cases (Did not check where the version comes from). When I check sessionInfo() I find in loaded via a namespace (and not attached): somewhere cli_3.6.0

Any idea what could be the problem here?

Kind regards, Christian

kevinushey commented 1 year ago

Any chance you can share a reproducible example?

cath-parkinson commented 10 months ago

Hi there,

I am experiencing the same issue, I also recently moved to renv 1.0.2.

When I load an R project in Rstudio, and then immediately run sessionInfo(), I can see that Rstudio has loaded via namespace (not attached) packages that it detects are used in the project. Sounds helpful - but unfortunately it looks to my global user library to grab whatever version it can find there - and therefore ignores the renv project library that I would actually like to use.

This results in the following type of error, when I run a script (in my case, an R shiny app), when my global user library uses a different package than specified in my renv project library.

Error: package or namespace load failed for ‘googleCloudStorageR’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘rlang’ 1.0.6 is already loaded, but >= 1.1.0 is required

If I restart R, sometimes twice times in a row, the error usually goes away. Sometimes I need to exit and re-enter the project and then restart a few times to get past the error.

From what I can understand from this unresolved issue on the Rstudio github page - this behaviour is intended as a "feature", it's just manifesting as a bug in my example, where really I want renv to control the packages that are loaded.

Is it something that could be handled on the renv side?

I should note it is possible to turn off this behaviour in Rstudio in your global settings, once you understand what is happening! Which is well explained here. But I for one spent quite a lot of time trying to debug before I realised this was the problem!

Session info below (sorry it's verbose - using many packages!) but it does show the discrepancies in the rlang package. Thanks for the work on renv, I couldn't survive without it!

Diagnostics Report [renv 1.0.2]
===============================

# Session Info ---------------------------------------------------------------
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
 [1] highcharter_0.8.2     readxl_1.3.1          shinyWidgets_0.6.3   
 [4] dashboardthemes_1.1.5 forcats_0.5.1         stringr_1.4.0        
 [7] dplyr_1.0.10          purrr_0.3.5           readr_1.4.0          
[10] tidyr_1.2.1           tibble_3.1.8          ggplot2_3.4.0        
[13] tidyverse_1.3.1       cicerone_1.0.4        shiny_1.7.1          

loaded via a namespace (and not attached):
 [1] fs_1.5.2                 xts_0.12.1               lubridate_1.7.10        
 [4] httr_1.4.4               tools_4.0.4              backports_1.2.1         
 [7] bslib_0.4.1              utf8_1.2.2               R6_2.5.1                
[10] DBI_1.1.1                lazyeval_0.2.2           colorspace_2.0-3        
[13] withr_2.4.3              tidyselect_1.2.0         curl_4.3.1              
[16] compiler_4.0.4           cli_3.4.1                rvest_1.0.0             
[19] xml2_1.3.2               plotly_4.10.1            rhandsontable_0.3.8     
[22] sass_0.4.4               scales_1.2.1             mm.reoptimise_0.2.9.9000
[25] digest_0.6.31            pkgconfig_2.0.3          htmltools_0.5.4         
[28] dbplyr_2.1.1             fastmap_1.1.0            htmlwidgets_1.5.4       
[31] rlang_1.0.6              TTR_0.24.2               rstudioapi_0.14         
[34] quantmod_0.4.18          jquerylib_0.1.4          generics_0.1.3          
[37] zoo_1.8-9                jsonlite_1.8.3           config_0.3.1            
[40] magrittr_2.0.3           rlist_0.4.6.1            Rcpp_1.0.9              
[43] munsell_0.5.0            fansi_1.0.3              lifecycle_1.0.3         
[46] stringi_1.6.2            yaml_2.3.5               grid_4.0.4              
[49] promises_1.2.0.1         crayon_1.4.2             lattice_0.20-41         
[52] haven_2.4.1              hms_1.1.0                pillar_1.8.1            
[55] igraph_1.3.0             reprex_2.0.0             glue_1.6.2              
[58] data.table_1.14.6        renv_1.0.2               modelr_0.1.8            
[61] vctrs_0.5.1              nloptr_2.0.3             httpuv_1.6.6            
[64] cellranger_1.1.0         gtable_0.3.1             assertthat_0.2.1        
[67] cachem_1.0.6             mime_0.12                xtable_1.8-4            
[70] broom_0.7.6              later_1.3.0              viridisLite_0.4.1       
[73] memoise_2.0.1            ellipsis_0.3.2          

# Project --------------------------------------------------------------------
Project path: "C:/Users/cpark/Documents/Development/Work/MeasureMonks/re_optimise"

# Status ---------------------------------------------------------------------
The following package(s) are out of sync [lockfile -> library]:

# CRAN -----------------------------------------------------------------------
- isoband         [0.2.7 -> 0.2.4]

# (Unknown Source) -----------------------------------------------------------
- mm.reoptimise   [cath-parkinson/mm.reoptimise@v0.4.4 -> 0.4.400092]

See ?renv::status() for advice on resolving these issues.

# Packages -------------------------------------------------------------------
                       Library    Source   Lockfile Source Path Dependency
BH                    1.75.0-0      CRAN   1.75.0-0   CRAN  [1]   indirect
DBI                      1.1.1      CRAN      1.1.1   CRAN  [1]   indirect
DT                        0.20      CRAN       0.20   CRAN  [1]     direct
KernSmooth             2.23-18      CRAN       <NA>   <NA>  [2]       <NA>
MASS                    7.3-55      CRAN     7.3-55   CRAN  [1]   indirect
Matrix                   1.3-2      CRAN      1.3-2   CRAN  [2]   indirect
R.methodsS3              1.8.1      CRAN      1.8.1   CRAN  [1]   indirect
R.oo                    1.24.0      CRAN     1.24.0   CRAN  [1]   indirect
R.utils                 2.11.0      CRAN     2.11.0   CRAN  [1]   indirect
R6                       2.5.1      CRAN      2.5.1   CRAN  [1]   indirect
RColorBrewer             1.1-2      CRAN      1.1-2   CRAN  [1]   indirect
RSQLite                 2.2.12      CRAN     2.2.12   CRAN  [1]   indirect
Rcpp                     1.0.8      CRAN      1.0.8   CRAN  [1]   indirect
RcppArmadillo       0.10.8.1.0      CRAN 0.10.8.1.0   CRAN  [1]   indirect
Rttf2pt1                1.3.12      CRAN       <NA>   <NA>  [1]       <NA>
TTR                     0.24.2      CRAN     0.24.2   CRAN  [1]   indirect
XML                   3.99-0.9      CRAN   3.99-0.9   CRAN  [1]   indirect
askpass                    1.1      CRAN        1.1   CRAN  [1]   indirect
assertthat               0.2.1      CRAN      0.2.1   CRAN  [1]   indirect
backports                1.2.1      CRAN      1.2.1   CRAN  [1]   indirect
base64enc                0.1-3      CRAN      0.1-3   CRAN  [1]   indirect
billboarder              0.3.1      CRAN      0.3.1   CRAN  [1]   indirect
bit                      4.0.4      CRAN      4.0.4   CRAN  [1]   indirect
bit64                    4.0.5      CRAN      4.0.5   CRAN  [1]   indirect
blob                     1.2.1      CRAN      1.2.1   CRAN  [1]   indirect
boot                    1.3-26      CRAN       <NA>   <NA>  [2]       <NA>
brio                     1.1.3      CRAN       <NA>   <NA>  [1]       <NA>
broom                    0.7.6      CRAN      0.7.6   CRAN  [1]   indirect
bslib                    0.3.1      CRAN      0.3.1   CRAN  [1]   indirect
cachem                   1.0.6      CRAN      1.0.6   CRAN  [1]   indirect
callr                    3.7.0      CRAN      3.7.0   CRAN  [1]   indirect
cellranger               1.1.0      CRAN      1.1.0   CRAN  [1]   indirect
cicerone                 1.0.4      CRAN      1.0.4   CRAN  [1]     direct
class                   7.3-18      CRAN       <NA>   <NA>  [2]       <NA>
cli                      3.4.1      CRAN      3.4.1   CRAN  [1]   indirect
clipr                    0.7.1      CRAN      0.7.1   CRAN  [1]   indirect
cluster                  2.1.0      CRAN       <NA>   <NA>  [2]       <NA>
codetools               0.2-18      CRAN       <NA>   <NA>  [2]       <NA>
colorspace               2.0-1      CRAN      2.0-1   CRAN  [1]   indirect
commonmark                 1.7      CRAN        1.7   CRAN  [1]   indirect
compiler                  <NA>      <NA>       <NA>   <NA>  [2]   indirect
config                   0.3.1      CRAN      0.3.1   CRAN  [1]     direct
cpp11                    0.4.3      CRAN      0.4.3   CRAN  [1]   indirect
crayon                   1.4.2      CRAN      1.4.2   CRAN  [1]   indirect
crosstalk                1.1.1      CRAN      1.1.1   CRAN  [1]   indirect
curl                     4.3.1      CRAN      4.3.1   CRAN  [1]   indirect
dashboardthemes          1.1.5      CRAN      1.1.5   CRAN  [1]     direct
data.table              1.14.0      CRAN     1.14.0   CRAN  [1]   indirect
dbplyr                   2.1.1      CRAN      2.1.1   CRAN  [1]   indirect
desc                     1.4.1      CRAN       <NA>   <NA>  [1]       <NA>
diffobj                  0.3.5      CRAN       <NA>   <NA>  [1]       <NA>
digest                  0.6.29      CRAN     0.6.29   CRAN  [1]   indirect
dplyr                    1.0.6      CRAN      1.0.6   CRAN  [1]     direct
dtplyr                   1.1.0      CRAN      1.1.0   CRAN  [1]   indirect
ellipsis                 0.3.2      CRAN      0.3.2   CRAN  [1]   indirect
evaluate                  0.14      CRAN       0.14   CRAN  [1]   indirect
extrafont                 0.19      CRAN       <NA>   <NA>  [1]       <NA>
extrafontdb                1.0      CRAN       <NA>   <NA>  [1]       <NA>
fansi                    0.5.0      CRAN      0.5.0   CRAN  [1]   indirect
farver                   2.1.0      CRAN      2.1.0   CRAN  [1]   indirect
fastmap                  1.1.0      CRAN      1.1.0   CRAN  [1]   indirect
fontawesome              0.2.2      CRAN      0.2.2   CRAN  [1]   indirect
forcats                  0.5.1      CRAN      0.5.1   CRAN  [1]   indirect
forecast                  8.16      CRAN       8.16   CRAN  [1]   indirect
foreign                 0.8-81      CRAN       <NA>   <NA>  [2]       <NA>
formattable              0.2.1      CRAN      0.2.1   CRAN  [1]     direct
fracdiff                 1.5-1      CRAN      1.5-1   CRAN  [1]   indirect
fresh                    0.2.0      CRAN       <NA>   <NA>  [1]       <NA>
fs                       1.5.2      CRAN      1.5.2   CRAN  [1]   indirect
gargle                   1.4.0      CRAN      1.4.0   CRAN  [1]   indirect
generics                 0.1.0      CRAN      0.1.0   CRAN  [1]   indirect
ggplot2                  3.3.3      CRAN      3.3.3   CRAN  [1]     direct
glue                     1.6.2      CRAN      1.6.2   CRAN  [1]   indirect
googleAuthR              2.0.1      CRAN      2.0.1   CRAN  [1]   indirect
googleCloudStorageR      0.7.0      CRAN      0.7.0   CRAN  [1]     direct
googledrive              1.0.1      CRAN      1.0.1   CRAN  [1]   indirect
googlesheets4            0.3.0      CRAN      0.3.0   CRAN  [1]   indirect
grDevices                 <NA>      <NA>       <NA>   <NA>  [2]   indirect
graphics                  <NA>      <NA>       <NA>   <NA>  [2]   indirect
grid                      <NA>      <NA>       <NA>   <NA>  [2]   indirect
gsubfn                     0.7      CRAN        0.7   CRAN  [1]     direct
gtable                   0.3.0      CRAN      0.3.0   CRAN  [1]   indirect
haven                    2.4.1      CRAN      2.4.1   CRAN  [1]   indirect
highcharter              0.8.2      CRAN      0.8.2   CRAN  [1]     direct
highr                      0.9      CRAN        0.9   CRAN  [1]   indirect
hms                      1.1.0      CRAN      1.1.0   CRAN  [1]   indirect
htmltools                0.5.2      CRAN      0.5.2   CRAN  [1]     direct
htmlwidgets              1.5.4      CRAN      1.5.4   CRAN  [1]     direct
httpuv                   1.6.5      CRAN      1.6.5   CRAN  [1]   indirect
httr                     1.4.6      CRAN      1.4.6   CRAN  [1]   indirect
ids                      1.0.1      CRAN      1.0.1   CRAN  [1]   indirect
igraph                   1.3.0      CRAN      1.3.0   CRAN  [1]   indirect
isoband                  0.2.4      CRAN      0.2.7   CRAN  [1]   indirect
jquerylib                0.1.4      CRAN      0.1.4   CRAN  [1]   indirect
jsonlite                 1.7.3      CRAN      1.7.3   CRAN  [1]   indirect
kableExtra               1.3.4      CRAN      1.3.4   CRAN  [1]     direct
knitr                     1.33      CRAN       1.33   CRAN  [1]   indirect
labeling                 0.4.2      CRAN      0.4.2   CRAN  [1]   indirect
later                    1.3.0      CRAN      1.3.0   CRAN  [1]   indirect
lattice                0.20-41      CRAN    0.20-41   CRAN  [2]   indirect
lazyeval                 0.2.2      CRAN      0.2.2   CRAN  [1]   indirect
lifecycle                1.0.1      CRAN      1.0.1   CRAN  [1]   indirect
lmtest                  0.9-39      CRAN     0.9-39   CRAN  [1]   indirect
lubridate               1.7.10      CRAN     1.7.10   CRAN  [1]     direct
magrittr                 2.0.3      CRAN      2.0.3   CRAN  [1]   indirect
markdown                   1.1      CRAN        1.1   CRAN  [1]   indirect
memoise                  2.0.1      CRAN      2.0.1   CRAN  [1]   indirect
methods                   <NA>      <NA>       <NA>   <NA>  [2]   indirect
mgcv                    1.8-33      CRAN     1.8-33   CRAN  [2]   indirect
mime                      0.12      CRAN       0.12   CRAN  [1]   indirect
mm.nestingscript         1.0.1 Bitbucket       <NA>   <NA>  [1]       <NA>
mm.reoptimise       0.4.400092   unknown      0.4.4 GitHub  [1]     direct
modelr                   0.1.8      CRAN      0.1.8   CRAN  [1]   indirect
munsell                  0.5.0      CRAN      0.5.0   CRAN  [1]   indirect
nlme                   3.1-155      CRAN    3.1-155   CRAN  [1]   indirect
nloptr                 1.2.2.3      CRAN    1.2.2.3   CRAN  [1]     direct
nnet                    7.3-15      CRAN     7.3-15   CRAN  [2]   indirect
openssl                  2.1.0      CRAN      2.1.0   CRAN  [1]   indirect
openxlsx                 4.2.3      CRAN      4.2.3   CRAN  [1]     direct
packrat                  0.7.0      CRAN      0.7.0   CRAN  [1]   indirect
parallel                  <NA>      <NA>       <NA>   <NA>  [2]   indirect
pillar                   1.6.1      CRAN      1.6.1   CRAN  [1]   indirect
pkgbuild                 1.4.2      CRAN       <NA>   <NA>  [1]       <NA>
pkgconfig                2.0.3      CRAN      2.0.3   CRAN  [1]   indirect
pkgload                  1.2.4      CRAN       <NA>   <NA>  [1]       <NA>
plogr                    0.2.0      CRAN      0.2.0   CRAN  [1]   indirect
plotly                   4.9.3      CRAN      4.9.3   CRAN  [1]     direct
praise                   1.0.0      CRAN       <NA>   <NA>  [1]       <NA>
prettyunits              1.1.1      CRAN      1.1.1   CRAN  [1]   indirect
processx                 3.5.2      CRAN      3.5.2   CRAN  [1]   indirect
profvis                  0.3.7      CRAN       <NA>   <NA>  [1]       <NA>
progress                 1.2.2      CRAN      1.2.2   CRAN  [1]   indirect
promises               1.2.0.1      CRAN    1.2.0.1   CRAN  [1]   indirect
proto                    1.0.0      CRAN      1.0.0   CRAN  [1]   indirect
ps                       1.6.0      CRAN      1.6.0   CRAN  [1]   indirect
purrr                    0.3.4      CRAN      0.3.4   CRAN  [1]   indirect
quadprog                 1.5-8      CRAN      1.5-8   CRAN  [1]   indirect
quantmod                0.4.18      CRAN     0.4.18   CRAN  [1]   indirect
rappdirs                 0.3.3      CRAN      0.3.3   CRAN  [1]   indirect
reactlog                 1.1.1      CRAN       <NA>   <NA>  [1]       <NA>
readr                    1.4.0      CRAN      1.4.0   CRAN  [1]   indirect
readxl                   1.3.1      CRAN      1.3.1   CRAN  [1]     direct
rematch                  1.0.1      CRAN      1.0.1   CRAN  [1]   indirect
rematch2                 2.1.2      CRAN      2.1.2   CRAN  [1]   indirect
remotes                  2.4.2      CRAN       <NA>   <NA>  [1]       <NA>
renv                     1.0.2      CRAN      1.0.2   CRAN  [1]     direct
reprex                   2.0.0      CRAN      2.0.0   CRAN  [1]   indirect
rhandsontable            0.3.8      CRAN      0.3.8   CRAN  [1]     direct
rjson                   0.2.20      CRAN     0.2.20   CRAN  [1]   indirect
rlang                    1.1.1      CRAN      1.1.1   CRAN  [1]     direct
rlist                  0.4.6.1      CRAN    0.4.6.1   CRAN  [1]   indirect
rmarkdown                  2.8      CRAN        2.8   CRAN  [1]   indirect
rpart                   4.1-15      CRAN       <NA>   <NA>  [2]       <NA>
rprojroot                2.0.3      CRAN       <NA>   <NA>  [1]       <NA>
rsconnect                1.0.2      CRAN      1.0.2   CRAN  [1]     direct
rstudioapi                0.13      CRAN       0.13   CRAN  [1]   indirect
rvest                    1.0.0      CRAN      1.0.0   CRAN  [1]     direct
sass                     0.4.0      CRAN      0.4.0   CRAN  [1]   indirect
scales                   1.1.1      CRAN      1.1.1   CRAN  [1]     direct
scrypt                   0.1.3      CRAN      0.1.3   CRAN  [1]   indirect
selectr                  0.4-2      CRAN      0.4-2   CRAN  [1]   indirect
shiny                    1.7.1      CRAN      1.7.1   CRAN  [1]     direct
shinyBS                   0.61      CRAN       0.61   CRAN  [1]     direct
shinyFeedback            0.4.0      CRAN      0.4.0   CRAN  [1]     direct
shinyWidgets             0.6.3      CRAN      0.6.3   CRAN  [1]     direct
shinyalert               3.0.0      CRAN      3.0.0   CRAN  [1]     direct
shinybusy                0.3.0      CRAN      0.3.0   CRAN  [1]     direct
shinycssloaders          1.0.0      CRAN      1.0.0   CRAN  [1]     direct
shinycustomloader        0.9.0      CRAN      0.9.0   CRAN  [1]     direct
shinydashboard           0.7.1      CRAN      0.7.1   CRAN  [1]     direct
shinyjs                  2.1.0      CRAN      2.1.0   CRAN  [1]     direct
shinymanager           1.0.400      CRAN    1.0.400   CRAN  [1]     direct
shinyvalidate            0.1.2      CRAN       <NA>   <NA>  [1]       <NA>
sourcetools              0.1.7      CRAN      0.1.7   CRAN  [1]   indirect
spatial                 7.3-13      CRAN       <NA>   <NA>  [2]       <NA>
splines                   <NA>      <NA>       <NA>   <NA>  [2]   indirect
stats                     <NA>      <NA>       <NA>   <NA>  [2]     direct
stringi                  1.6.2      CRAN      1.6.2   CRAN  [1]   indirect
stringr                  1.4.0      CRAN      1.4.0   CRAN  [1]     direct
survival                 3.2-7      CRAN       <NA>   <NA>  [2]       <NA>
svglite                  2.0.0      CRAN      2.0.0   CRAN  [1]   indirect
sys                        3.4      CRAN        3.4   CRAN  [1]   indirect
systemfonts              1.0.2      CRAN      1.0.2   CRAN  [1]   indirect
testthat                 3.1.3      CRAN       <NA>   <NA>  [1]       <NA>
tibble                   3.1.2      CRAN      3.1.2   CRAN  [1]     direct
tidyr                    1.1.3      CRAN      1.1.3   CRAN  [1]     direct
tidyselect               1.1.1      CRAN      1.1.1   CRAN  [1]   indirect
tidyverse                1.3.1      CRAN      1.3.1   CRAN  [1]     direct
timeDate              3043.102      CRAN   3043.102   CRAN  [1]   indirect
tinytex                   0.31      CRAN       0.31   CRAN  [1]   indirect
tools                     <NA>      <NA>       <NA>   <NA>  [2]     direct
tseries                0.10-49      CRAN    0.10-49   CRAN  [1]   indirect
tsoutliers               0.6-8      CRAN      0.6-8   CRAN  [1]     direct
tzdb                     0.3.0      CRAN       <NA>   <NA>  [1]       <NA>
urca                     1.3-0      CRAN      1.3-0   CRAN  [1]   indirect
utf8                     1.2.1      CRAN      1.2.1   CRAN  [1]   indirect
utils                     <NA>      <NA>       <NA>   <NA>  [2]   indirect
uuid                     0.1-4      CRAN      0.1-4   CRAN  [1]   indirect
vctrs                    0.3.8      CRAN      0.3.8   CRAN  [1]   indirect
viridisLite              0.4.0      CRAN      0.4.0   CRAN  [1]   indirect
vroom                    1.6.0      CRAN       <NA>   <NA>  [1]       <NA>
waldo                    0.4.0      CRAN       <NA>   <NA>  [1]       <NA>
webshot                  0.5.2      CRAN      0.5.2   CRAN  [1]   indirect
withr                    2.4.3      CRAN      2.4.3   CRAN  [1]   indirect
writexl                  1.4.0      CRAN      1.4.0   CRAN  [1]     direct
xfun                      0.23      CRAN       0.23   CRAN  [1]   indirect
xml2                     1.3.2      CRAN      1.3.2   CRAN  [1]     direct
xtable                   1.8-4      CRAN      1.8-4   CRAN  [1]   indirect
xts                     0.12.1      CRAN     0.12.1   CRAN  [1]   indirect
yaml                     2.3.5      CRAN      2.3.5   CRAN  [1]   indirect
zip                      2.1.1      CRAN      2.1.1   CRAN  [1]   indirect
zoo                      1.8-9      CRAN      1.8-9   CRAN  [1]     direct

[1]: C:/Users/cpark/Documents/Development/Work/MeasureMonks/re_optimise/renv/library/R-4.0/x86_64-w64-mingw32
[2]: C:/Users/cpark/AppData/Local/R/cache/R/renv/sandbox/R-4.0/x86_64-w64-mingw32/b7d55bae                   

# ABI ------------------------------------------------------------------------
- ABI conflict checks are not yet implemented on Windows.

# User Profile ---------------------------------------------------------------
[no user profile detected]

# Settings -------------------------------------------------------------------
List of 13
 $ bioconductor.version     : NULL
 $ external.libraries       : chr(0) 
 $ ignored.packages         : chr(0) 
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ ppm.enabled              : NULL
 $ ppm.ignored.urls         : chr(0) 
 $ r.version                : chr(0) 
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE
 $ vcs.manage.ignores       : logi TRUE

# Options --------------------------------------------------------------------
List of 9
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : chr "wininet"
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: chr "interactive"
 $ pkgType                             : chr "both"
 $ repos                               : Named chr "https://cran.rstudio.com/"
  ..- attr(*, "names")= chr "CRAN"
 $ renv.config.mran.enabled            : logi FALSE
 $ renv.consent                        : logi TRUE
 $ renv.verbose                        : logi TRUE

# Environment Variables ------------------------------------------------------
HOME                        = C:/Users/cpark/OneDrive/Documents
LANG                        = <NA>
MAKE                        = <NA>
R_LIBS                      = <NA>
R_LIBS_SITE                 = <NA>
R_LIBS_USER                 = C:/Users/cpark/Documents/Development/Work/MeasureMonks/re_optimise/renv/library/R-4.0/x86_64-w64-mingw32
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = <NA>
RENV_DEFAULT_R_LIBS_USER    = C:\Users\cpark\Documents\R\win-library\4.0
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PROJECT                = C:/Users/cpark/Documents/Development/Work/MeasureMonks/re_optimise

# PATH -----------------------------------------------------------------------
- C:\rtools40\usr\bin
- C:\Users\cpark\AppData\Local\Programs\Python\Python39\Scripts
- C:\Users\cpark\AppData\Local\Programs\Python\Python39
- C:\rtools40\usr\bin
- C:\Program Files\R\R-4.0.4\bin\x64
- C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Windows\System32\OpenSSH\
- C:\Program Files\dotnet\
- C:\Program Files\Git\cmd
- C:\Program Files\R\R-4.0.4\bin\x64
- C:\Program Files\PuTTY\
- C:\Program Files\Docker\Docker\resources\bin
- C:\Users\cpark\AppData\Local\Microsoft\WindowsApps
- C:\Users\cpark\.dotnet\tools
- C:\Program Files\RStudio\resources\app\bin\quarto\bin
- C:\Program Files\RStudio\resources\app\bin\postback

# Cache ----------------------------------------------------------------------
There are a total of 644 packages installed in the renv cache.
Cache path: "C:/Users/cpark/AppData/Local/R/cache/R/renv/cache/v5/R-4.0/x86_64-w64-mingw32"
kevinushey commented 10 months ago

When I load an R project in Rstudio, and then immediately run sessionInfo(), I can see that Rstudio has loaded via namespace (not attached) packages that it detects are used in the project. Sounds helpful - but unfortunately it looks to my global user library to grab whatever version it can find there - and therefore ignores the renv project library that I would actually like to use.

Is this true even with the renv project library being automatically activated on startup? Or are you manually loading renv post-hoc via renv::load() or something else?

cath-parkinson commented 10 months ago

All automatic - the renv project library is activated by source("renv/activate.R") in .Rprofile. I'm using the recommended renv workflow (no adjustments or work arounds). My process to get the above error message - open project, restart R, then attempt to run my R shiny app.

kevinushey commented 10 months ago

Thanks! We'll try to take a look at this soon.

aowenson-imm commented 10 months ago

I too get this error, but in a simple R script not RStudio. And hopefully I have a simple reproducible example:

Only workaround I have is manually-updating Matrix first.

kevinushey commented 9 months ago

Thanks, I think I was able to reproduce. This was with R 4.2.3 on Ubuntu 22.04:

$ R

R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

- Project '/tmp/tmp.RuW14QFtQt' loaded. [renv 1.0.3]
> find.package("Matrix")
[1] "/home/kevin/.cache/R/renv/sandbox/R-4.2/aarch64-unknown-linux-gnu/e11edd0e/Matrix"
> packageVersion("Matrix")
[1] ‘1.5.3’
> renv::install("Seurat")
# Downloading packages -------------------------------------------------------
- Downloading Seurat from CRAN ...              OK [file is up to date]
- Downloading cowplot from CRAN ...             OK [file is up to date]
- Downloading ggplot2 from CRAN ...             OK [file is up to date]
- Downloading cli from CRAN ...                 OK [file is up to date]
- Downloading glue from CRAN ...                OK [file is up to date]
- Downloading gtable from CRAN ...              OK [file is up to date]
- Downloading lifecycle from CRAN ...           OK [file is up to date]
- Downloading rlang from CRAN ...               OK [file is up to date]
- Downloading isoband from CRAN ...             OK [file is up to date]
- Downloading scales from CRAN ...              OK [file is up to date]
- Downloading farver from CRAN ...              OK [file is up to date]
- Downloading labeling from CRAN ...            OK [file is up to date]
- Downloading munsell from CRAN ...             OK [file is up to date]
- Downloading colorspace from CRAN ...          OK [file is up to date]
- Downloading R6 from CRAN ...                  OK [file is up to date]
- Downloading RColorBrewer from CRAN ...        OK [file is up to date]
- Downloading viridisLite from CRAN ...         OK [file is up to date]
- Downloading tibble from CRAN ...              OK [file is up to date]
- Downloading fansi from CRAN ...               OK [file is up to date]
- Downloading magrittr from CRAN ...            OK [file is up to date]
- Downloading pillar from CRAN ...              OK [file is up to date]
- Downloading utf8 from CRAN ...                OK [file is up to date]
- Downloading vctrs from CRAN ...               OK [file is up to date]
- Downloading pkgconfig from CRAN ...           OK [file is up to date]
- Downloading withr from CRAN ...               OK [file is up to date]
- Downloading fastDummies from CRAN ...         OK [file is up to date]
- Downloading data.table from CRAN ...          OK [file is up to date]
- Downloading stringr from CRAN ...             OK [file is up to date]
- Downloading stringi from CRAN ...             OK [file is up to date]
- Downloading fitdistrplus from CRAN ...        OK [file is up to date]
- Downloading future from CRAN ...              OK [file is up to date]
- Downloading digest from CRAN ...              OK [file is up to date]
- Downloading globals from CRAN ...             OK [file is up to date]
- Downloading listenv from CRAN ...             OK [file is up to date]
- Downloading parallelly from CRAN ...          OK [file is up to date]
- Downloading future.apply from CRAN ...        OK [file is up to date]
- Downloading generics from CRAN ...            OK [file is up to date]
- Downloading ggrepel from CRAN ...             OK [file is up to date]
- Downloading Rcpp from CRAN ...                OK [file is up to date]
- Downloading ggridges from CRAN ...            OK [file is up to date]
- Downloading httr from CRAN ...                OK [file is up to date]
- Downloading curl from CRAN ...                OK [file is up to date]
- Downloading jsonlite from CRAN ...            OK [file is up to date]
- Downloading mime from CRAN ...                OK [file is up to date]
- Downloading openssl from CRAN ...             OK [file is up to date]
- Downloading askpass from CRAN ...             OK [file is up to date]
- Downloading sys from CRAN ...                 OK [file is up to date]
- Downloading ica from CRAN ...                 OK [file is up to date]
- Downloading igraph from CRAN ...              OK [file is up to date]
- Downloading cpp11 from CRAN ...               OK [file is up to date]
- Downloading irlba from CRAN ...               OK [file is up to date]
- Downloading leiden from CRAN ...              OK [file is up to date]
- Downloading reticulate from CRAN ...          OK [file is up to date]
- Downloading RcppTOML from CRAN ...            OK [file is up to date]
- Downloading here from CRAN ...                OK [file is up to date]
- Downloading rprojroot from CRAN ...           OK [file is up to date]
- Downloading png from CRAN ...                 OK [file is up to date]
- Downloading rappdirs from CRAN ...            OK [file is up to date]
- Downloading lmtest from CRAN ...              OK [file is up to date]
- Downloading zoo from CRAN ...                 OK [file is up to date]
- Downloading matrixStats from CRAN ...         OK [file is up to date]
- Downloading miniUI from CRAN ...              OK [file is up to date]
- Downloading shiny from CRAN ...               OK [file is up to date]
- Downloading httpuv from CRAN ...              OK [file is up to date]
- Downloading later from CRAN ...               OK [file is up to date]
- Downloading promises from CRAN ...            OK [file is up to date]
- Downloading fastmap from CRAN ...             OK [file is up to date]
- Downloading xtable from CRAN ...              OK [file is up to date]
- Downloading fontawesome from CRAN ...         OK [file is up to date]
- Downloading htmltools from CRAN ...           OK [file is up to date]
- Downloading base64enc from CRAN ...           OK [file is up to date]
- Downloading ellipsis from CRAN ...            OK [file is up to date]
- Downloading sourcetools from CRAN ...         OK [file is up to date]
- Downloading crayon from CRAN ...              OK [file is up to date]
- Downloading commonmark from CRAN ...          OK [file is up to date]
- Downloading bslib from CRAN ...               OK [file is up to date]
- Downloading cachem from CRAN ...              OK [file is up to date]
- Downloading jquerylib from CRAN ...           OK [file is up to date]
- Downloading memoise from CRAN ...             OK [file is up to date]
- Downloading sass from CRAN ...                OK [file is up to date]
- Downloading fs from CRAN ...                  OK [file is up to date]
- Downloading patchwork from CRAN ...           OK [file is up to date]
- Downloading pbapply from CRAN ...             OK [file is up to date]
- Downloading plotly from CRAN ...              OK [file is up to date]
- Downloading htmlwidgets from CRAN ...         OK [file is up to date]
- Downloading knitr from CRAN ...               OK [file is up to date]
- Downloading evaluate from CRAN ...            OK [file is up to date]
- Downloading highr from CRAN ...               OK [file is up to date]
- Downloading xfun from CRAN ...                OK [file is up to date]
- Downloading yaml from CRAN ...                OK [file is up to date]
- Downloading rmarkdown from CRAN ...           OK [file is up to date]
- Downloading tinytex from CRAN ...             OK [file is up to date]
- Downloading tidyr from CRAN ...               OK [file is up to date]
- Downloading dplyr from CRAN ...               OK [file is up to date]
- Downloading tidyselect from CRAN ...          OK [file is up to date]
- Downloading purrr from CRAN ...               OK [file is up to date]
- Downloading lazyeval from CRAN ...            OK [file is up to date]
- Downloading crosstalk from CRAN ...           OK [file is up to date]
- Downloading progressr from CRAN ...           OK [file is up to date]
- Downloading RANN from CRAN ...                OK [file is up to date]
- Downloading RcppAnnoy from CRAN ...           OK [file is up to date]
- Downloading RcppHNSW from CRAN ...            OK [file is up to date]
- Downloading ROCR from CRAN ...                OK [file is up to date]
- Downloading gplots from CRAN ...              OK [file is up to date]
- Downloading gtools from CRAN ...              OK [file is up to date]
- Downloading caTools from CRAN ...             OK [file is up to date]
- Downloading bitops from CRAN ...              OK [file is up to date]
- Downloading RSpectra from CRAN ...            OK [file is up to date]
- Downloading RcppEigen from CRAN ...           OK [file is up to date]
- Downloading Rtsne from CRAN ...               OK [file is up to date]
- Downloading scattermore from CRAN ...         OK [file is up to date]
- Downloading sctransform from CRAN ...         OK [file is up to date]
- Downloading reshape2 from CRAN ...            OK [file is up to date]
- Downloading plyr from CRAN ...                OK [file is up to date]
- Downloading gridExtra from CRAN ...           OK [file is up to date]
- Downloading RcppArmadillo from CRAN ...       OK [file is up to date]
- Downloading spatstat.explore from CRAN ...    OK [file is up to date]
- Downloading spatstat.data from CRAN ...       OK [file is up to date]
- Downloading spatstat.utils from CRAN ...      OK [file is up to date]
- Downloading spatstat.geom from CRAN ...       OK [file is up to date]
- Downloading deldir from CRAN ...              OK [file is up to date]
- Downloading polyclip from CRAN ...            OK [file is up to date]
- Downloading spatstat.random from CRAN ...     OK [file is up to date]
- Downloading spatstat.sparse from CRAN ...     OK [file is up to date]
- Downloading abind from CRAN ...               OK [file is up to date]
- Downloading tensor from CRAN ...              OK [file is up to date]
- Downloading goftest from CRAN ...             OK [file is up to date]
- Downloading uwot from CRAN ...                OK [file is up to date]
- Downloading FNN from CRAN ...                 OK [file is up to date]
- Downloading RcppProgress from CRAN ...        OK [file is up to date]
- Downloading dqrng from CRAN ...               OK [file is up to date]
- Downloading BH from CRAN ...                  OK [file is up to date]
- Downloading sitmo from CRAN ...               OK [file is up to date]
- Downloading SeuratObject from CRAN ...        OK [file is up to date]
- Downloading sp from CRAN ...                  OK [file is up to date]
- Downloading spam from CRAN ...                OK [file is up to date]
- Downloading dotCall64 from CRAN ...           OK [file is up to date]
Successfully downloaded 137 packages in 23 seconds.

The following package(s) will be installed:
- abind            [1.4-5]
- askpass          [1.2.0]
- base64enc        [0.1-3]
- BH               [1.81.0-1]
- bitops           [1.0-7]
- bslib            [0.6.1]
- cachem           [1.0.8]
- caTools          [1.18.2]
- cli              [3.6.1]
- colorspace       [2.1-0]
- commonmark       [1.9.0]
- cowplot          [1.1.1]
- cpp11            [0.4.6]
- crayon           [1.5.2]
- crosstalk        [1.2.1]
- curl             [5.1.0]
- data.table       [1.14.8]
- deldir           [2.0-2]
- digest           [0.6.33]
- dotCall64        [1.1-1]
- dplyr            [1.1.4]
- dqrng            [0.3.2]
- ellipsis         [0.3.2]
- evaluate         [0.23]
- fansi            [1.0.5]
- farver           [2.1.1]
- fastDummies      [1.7.3]
- fastmap          [1.1.1]
- fitdistrplus     [1.1-11]
- FNN              [1.1.3.2]
- fontawesome      [0.5.2]
- fs               [1.6.3]
- future           [1.33.0]
- future.apply     [1.11.0]
- generics         [0.1.3]
- ggplot2          [3.4.4]
- ggrepel          [0.9.4]
- ggridges         [0.5.4]
- globals          [0.16.2]
- glue             [1.6.2]
- goftest          [1.2-3]
- gplots           [3.1.3]
- gridExtra        [2.3]
- gtable           [0.3.4]
- gtools           [3.9.5]
- here             [1.0.1]
- highr            [0.10]
- htmltools        [0.5.7]
- htmlwidgets      [1.6.3]
- httpuv           [1.6.12]
- httr             [1.4.7]
- ica              [1.0-3]
- igraph           [1.5.1]
- irlba            [2.3.5.1]
- isoband          [0.2.7]
- jquerylib        [0.1.4]
- jsonlite         [1.8.7]
- knitr            [1.45]
- labeling         [0.4.3]
- later            [1.3.1]
- lazyeval         [0.2.2]
- leiden           [0.4.3.1]
- lifecycle        [1.0.4]
- listenv          [0.9.0]
- lmtest           [0.9-40]
- magrittr         [2.0.3]
- matrixStats      [1.1.0]
- memoise          [2.0.1]
- mime             [0.12]
- miniUI           [0.1.1.1]
- munsell          [0.5.0]
- openssl          [2.1.1]
- parallelly       [1.36.0]
- patchwork        [1.1.3]
- pbapply          [1.7-2]
- pillar           [1.9.0]
- pkgconfig        [2.0.3]
- plotly           [4.10.3]
- plyr             [1.8.9]
- png              [0.1-8]
- polyclip         [1.10-6]
- progressr        [0.14.0]
- promises         [1.2.1]
- purrr            [1.0.2]
- R6               [2.5.1]
- RANN             [2.6.1]
- rappdirs         [0.3.3]
- RColorBrewer     [1.1-3]
- Rcpp             [1.0.11]
- RcppAnnoy        [0.0.21]
- RcppArmadillo    [0.12.6.6.0]
- RcppEigen        [0.3.3.9.4]
- RcppHNSW         [0.5.0]
- RcppProgress     [0.4.2]
- RcppTOML         [0.2.2]
- reshape2         [1.4.4]
- reticulate       [1.34.0]
- rlang            [1.1.2]
- rmarkdown        [2.25]
- ROCR             [1.0-11]
- rprojroot        [2.0.4]
- RSpectra         [0.16-1]
- Rtsne            [0.16]
- sass             [0.4.7]
- scales           [1.3.0]
- scattermore      [1.2]
- sctransform      [0.4.1]
- Seurat           [5.0.1]
- SeuratObject     [5.0.1]
- shiny            [1.8.0]
- sitmo            [2.0.2]
- sourcetools      [0.1.7-1]
- sp               [2.1-2]
- spam             [2.10-0]
- spatstat.data    [3.0-3]
- spatstat.explore [3.2-5]
- spatstat.geom    [3.2-7]
- spatstat.random  [3.2-2]
- spatstat.sparse  [3.0-3]
- spatstat.utils   [3.0-4]
- stringi          [1.8.2]
- stringr          [1.5.1]
- sys              [3.4.2]
- tensor           [1.5]
- tibble           [3.2.1]
- tidyr            [1.3.0]
- tidyselect       [1.2.0]
- tinytex          [0.49]
- utf8             [1.2.4]
- uwot             [0.1.16]
- vctrs            [0.6.4]
- viridisLite      [0.4.2]
- withr            [2.5.2]
- xfun             [0.41]
- xtable           [1.8-4]
- yaml             [2.3.7]
- zoo              [1.8-12]
These packages will be installed into "/tmp/tmp.RuW14QFtQt/renv/library/R-4.2/aarch64-unknown-linux-gnu".

Do you want to proceed? [Y/n]: y

# Installing packages --------------------------------------------------------
- Installing cli ...                            OK [built from source and cached in 5.4s]
- Installing glue ...                           OK [built from source and cached in 1.0s]
- Installing rlang ...                          OK [built from source and cached in 7.7s]
- Installing lifecycle ...                      OK [built from source and cached in 1.0s]
- Installing gtable ...                         OK [built from source and cached in 1.2s]
- Installing isoband ...                        OK [built from source and cached in 2.9s]
- Installing farver ...                         OK [built from source and cached in 13s]
- Installing labeling ...                       OK [built from source and cached in 0.87s]
- Installing colorspace ...                     OK [built from source and cached in 3.8s]
- Installing munsell ...                        OK [built from source and cached in 0.9s]
- Installing R6 ...                             OK [built from source and cached in 0.76s]
- Installing RColorBrewer ...                   OK [built from source and cached in 0.91s]
- Installing viridisLite ...                    OK [built from source and cached in 0.65s]
- Installing scales ...                         OK [built from source and cached in 2.9s]
- Installing fansi ...                          OK [built from source and cached in 2.8s]
- Installing magrittr ...                       OK [built from source and cached in 0.89s]
- Installing utf8 ...                           OK [built from source and cached in 2.4s]
- Installing vctrs ...                          OK [built from source and cached in 12s]
- Installing pillar ...                         OK [built from source and cached in 2.2s]
- Installing pkgconfig ...                      OK [built from source and cached in 0.58s]
- Installing tibble ...                         OK [built from source and cached in 2.2s]
- Installing withr ...                          OK [built from source and cached in 0.93s]
- Installing ggplot2 ...                        OK [built from source and cached in 8.8s]
- Installing cowplot ...                        OK [built from source and cached in 2.2s]
- Installing data.table ...                     OK [built from source and cached in 14s]
- Installing stringi ...                        OK [built from source and cached in 38s]
- Installing stringr ...                        OK [built from source and cached in 1.6s]
- Installing fastDummies ...                    OK [built from source and cached in 0.75s]
- Installing fitdistrplus ...                   OK [built from source and cached in 4.9s]
- Installing digest ...                         OK [built from source and cached in 2.8s]
- Installing globals ...                        OK [built from source and cached in 1.1s]
- Installing listenv ...                        OK [built from source and cached in 1.0s]
- Installing parallelly ...                     OK [built from source and cached in 1.8s]
- Installing future ...                         OK [built from source and cached in 2.9s]
- Installing future.apply ...                   OK [built from source and cached in 1.4s]
- Installing generics ...                       OK [built from source and cached in 0.89s]
- Installing Rcpp ...                           OK [built from source and cached in 16s]
- Installing ggrepel ...                        OK [built from source and cached in 7.1s]
- Installing ggridges ...                       OK [built from source and cached in 2.6s]
- Installing curl ...                           OK [built from source and cached in 2.4s]
- Installing jsonlite ...                       OK [built from source and cached in 2.8s]
- Installing mime ...                           OK [built from source and cached in 0.77s]
- Installing sys ...                            OK [built from source and cached in 0.85s]
- Installing askpass ...                        OK [built from source and cached in 0.7s]
- Installing openssl ...                        OK [built from source and cached in 3.5s]
- Installing httr ...                           OK [built from source and cached in 2.2s]
- Installing ica ...                            OK [built from source and cached in 1.1s]
- Installing cpp11 ...                          OK [built from source and cached in 0.79s]
- Installing igraph ...                         OK [built from source and cached in 1.2m]
- Installing irlba ...                          OK [built from source and cached in 2.8s]
- Installing RcppTOML ...                       OK [built from source and cached in 6.9s]
- Installing rprojroot ...                      OK [built from source and cached in 0.82s]
- Installing here ...                           OK [built from source and cached in 0.7s]
- Installing png ...                            OK [built from source and cached in 0.86s]
- Installing rappdirs ...                       OK [built from source and cached in 0.74s]
- Installing reticulate ...                     OK [built from source and cached in 13s]
- Installing leiden ...                         OK [built from source and cached in 3.6s]
- Installing zoo ...                            OK [built from source and cached in 2.6s]
- Installing lmtest ...                         OK [built from source and cached in 1.6s]
- Installing matrixStats ...                    OK [built from source and cached in 7.0s]
- Installing later ...                          OK [built from source and cached in 9.9s]
- Installing fastmap ...                        OK [built from source and cached in 1.8s]
- Installing promises ...                       OK [built from source and cached in 5.5s]
- Installing httpuv ...                         OK [built from source and cached in 41s]
- Installing xtable ...                         OK [built from source and cached in 1.1s]
- Installing base64enc ...                      OK [built from source and cached in 0.8s]
- Installing ellipsis ...                       OK [built from source and cached in 0.93s]
- Installing htmltools ...                      OK [built from source and cached in 2.0s]
- Installing fontawesome ...                    OK [built from source and cached in 1.1s]
- Installing sourcetools ...                    OK [built from source and cached in 1.7s]
- Installing crayon ...                         OK [built from source and cached in 1.1s]
- Installing commonmark ...                     OK [built from source and cached in 6.3s]
- Installing cachem ...                         OK [built from source and cached in 1.1s]
- Installing jquerylib ...                      OK [built from source and cached in 0.89s]
- Installing memoise ...                        OK [built from source and cached in 0.94s]
- Installing fs ...                             OK [built from source and cached in 16s]
- Installing sass ...                           OK [built from source and cached in 59s]
- Installing bslib ...                          OK [built from source and cached in 3.2s]
- Installing shiny ...                          OK [built from source and cached in 11s]
- Installing miniUI ...                         OK [built from source and cached in 1.4s]
- Installing patchwork ...                      OK [built from source and cached in 2.5s]
- Installing pbapply ...                        OK [built from source and cached in 0.92s]
- Installing evaluate ...                       OK [built from source and cached in 0.86s]
- Installing xfun ...                           OK [built from source and cached in 1.8s]
- Installing highr ...                          OK [built from source and cached in 0.69s]
- Installing yaml ...                           OK [built from source and cached in 3.2s]
- Installing knitr ...                          OK [built from source and cached in 3.6s]
- Installing tinytex ...                        OK [built from source and cached in 0.95s]
- Installing rmarkdown ...                      OK [built from source and cached in 3.3s]
- Installing htmlwidgets ...                    OK [built from source and cached in 1.2s]
- Installing tidyselect ...                     OK [built from source and cached in 1.6s]
- Installing dplyr ...                          OK [built from source and cached in 6.2s]
- Installing purrr ...                          OK [built from source and cached in 2.6s]
- Installing tidyr ...                          OK [built from source and cached in 4.8s]
- Installing lazyeval ...                       OK [built from source and cached in 1.1s]
- Installing crosstalk ...                      OK [built from source and cached in 1.5s]
- Installing plotly ...                         OK [built from source and cached in 5.7s]
- Installing progressr ...                      OK [built from source and cached in 1.6s]
- Installing RANN ...                           OK [built from source and cached in 4.0s]
- Installing RcppAnnoy ...                      OK [built from source and cached in 16s]
- Installing RcppHNSW ...                       OK [built from source and cached in 12s]
- Installing gtools ...                         OK [built from source and cached in 1.3s]
- Installing bitops ...                         OK [built from source and cached in 0.77s]
- Installing caTools ...                        OK [built from source and cached in 1.6s]
- Installing gplots ...                         OK [built from source and cached in 2.1s]
- Installing ROCR ...                           OK [built from source and cached in 1.3s]
- Installing RcppEigen ...                      OK [built from source and cached in 26s]
- Installing RSpectra ...                       OK [built from source and cached in 1.1m]
- Installing Rtsne ...                          OK [built from source and cached in 11s]
- Installing scattermore ...                    OK [built from source and cached in 2.6s]
- Installing plyr ...                           OK [built from source and cached in 5.2s]
- Installing reshape2 ...                       OK [built from source and cached in 5.2s]
- Installing gridExtra ...                      OK [built from source and cached in 1.1s]
- Installing RcppArmadillo ...                  OK [built from source and cached in 13s]
- Installing sctransform ...                    OK [built from source and cached in 14s]
- Installing spatstat.utils ...                 OK [built from source and cached in 2.2s]
- Installing spatstat.data ...                  OK [built from source and cached in 3.1s]
- Installing deldir ...                         OK [built from source and cached in 2.0s]
- Installing polyclip ...                       OK [built from source and cached in 3.7s]
- Installing spatstat.geom ...                  OK [built from source and cached in 19s]
- Installing spatstat.random ...                OK [built from source and cached in 11s]
- Installing abind ...                          OK [built from source and cached in 0.78s]
- Installing tensor ...                         OK [built from source and cached in 0.58s]
- Installing spatstat.sparse ...                OK [built from source and cached in 3.0s]
- Installing goftest ...                        OK [built from source and cached in 0.81s]
- Installing spatstat.explore ...               OK [built from source and cached in 15s]
- Installing FNN ...                            OK [built from source and cached in 5.1s]
- Installing RcppProgress ...                   OK [built from source and cached in 0.47s]
- Installing BH ...                             OK [built from source and cached in 9.5s]
- Installing sitmo ...                          OK [built from source and cached in 7.5s]
- Installing dqrng ...                          OK [built from source and cached in 7.2s]
- Installing uwot ...                           OK [built from source and cached in 31s]
- Installing sp ...                             OK [built from source and cached in 5.4s]
- Installing dotCall64 ...                      OK [built from source and cached in 1.1s]
- Installing spam ...                           OK [built from source and cached in 13s]
- Installing SeuratObject ...                   FAILED
Error: Error installing package 'SeuratObject':
========================================

* installing *source* package ‘SeuratObject’ ...
** package ‘SeuratObject’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/opt/R/4.2.3/lib/R/include" -DNDEBUG  -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/Rcpp/include' -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/RcppEigen/include' -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++14 -I"/opt/R/4.2.3/lib/R/include" -DNDEBUG  -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/Rcpp/include' -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/RcppEigen/include' -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong   -fpic  -g -O2  -c data_manipulation.cpp -o data_manipulation.o
gcc -I"/opt/R/4.2.3/lib/R/include" -DNDEBUG  -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/Rcpp/include' -I'/tmp/tmp.RuW14QFtQt/renv/staging/1/RcppEigen/include' -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong   -fpic  -g -O2  -c valid_pointer.c -o valid_pointer.o
g++ -std=gnu++14 -shared -L/opt/R/4.2.3/lib/R/lib -L/usr/local/lib -o SeuratObject.so RcppExports.o data_manipulation.o valid_pointer.o -L/opt/R/4.2.3/lib/R/lib -lR
installing to /tmp/tmp.RuW14QFtQt/renv/staging/1/00LOCK-SeuratObject/00new/SeuratObject/libs
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  namespace ‘Matrix’ 1.5-3 is being loaded, but >= 1.6.3 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘SeuratObject’
* removing ‘/tmp/tmp.RuW14QFtQt/renv/staging/1/SeuratObject’
install of package 'SeuratObject' failed [error code 1]
Traceback (most recent calls last):
12: renv::install("Seurat")
11: renv_install_impl(records)
10: renv_install_staged(records)
 9: renv_install_default(records)
 8: handler(package, renv_install_package(record))
 7: renv_install_package(record)
 6: withCallingHandlers(renv_install_package_impl(record), error = function(e) writef("FAILED"))
 5: renv_install_package_impl(record)
 4: r_cmd_install(package, path)
 3: r_exec_error(package, output, "install", status)
 2: abort(all)
 1: stop(fallback)

It looks like renv is failing to see that a newer version of Matrix is required by the dependent package SeuratObject.

kevinushey commented 9 months ago

This should now be resolved in the latest development builds of renv -- you can install it with:

renv::install("rstudio/renv")

Please let me know if the issue persists for you with the latest versions. Thanks!

aowenson-imm commented 9 months ago

I confirm this fixes my issue.

kevinushey commented 9 months ago

Great, thanks for taking the time to confirm and report back!