1

I'm using renv for my private package (mdTools). devtools::install() works, but when I devtools::check(), it fails to find the DBI package, which is installed in my renv user cache.

devtools::check() error message

checking whether the package can be loaded ... ERROR
   Loading this package had a fatal error status code 1
  Loading log:
  Error: package or namespace load failed for 'mdTools' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
   there is no package called 'DBI'
  Execution halted

This was a previous similar problem not using renv: devtools::install() works but devtools::check() does not, so it is possible that this is not a renv problem. The answer there was to use the system library which doesn't seem like what I want to do.

What I've tried none of which resolved the issue

  • renv::remove("DBI") and renv::install("DBI")
  • renv::deactivate() and renv::init()
  • renv::clean()
  • renv::hydrate()
  • renv::purge("DBI") and renv::install("DBI")
  • renv::repair("DBI")
> renv::diagnostics()
Diagnostics Report [renv 0.16.0]
================================

# Session Info =======================
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

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

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

other attached packages:
[1] mdTools_0.0.0.9000

loaded via a namespace (and not attached):
 [1] qpdf_1.3.0          xfun_0.36           tidyselect_1.2.0   
 [4] janitor_2.1.0       purrr_1.0.0         rJava_1.0-6        
 [7] snakecase_0.11.0    vctrs_0.5.1         generics_0.1.3     
[10] htmltools_0.5.4     utf8_1.2.2          docxtractr_0.6.5   
[13] blob_1.2.3          rlang_1.0.6         pillar_1.8.1       
[16] glue_1.6.2          DBI_1.1.3           re2_0.1.2          
[19] rappdirs_0.3.3      bit64_4.0.5         readxl_1.4.1       
[22] rptTools_0.0.0.9000 uuid_1.1-0          lifecycle_1.0.3    
[25] stringr_1.5.0       cellranger_1.1.0    zip_2.2.2          
[28] AzureGraph_1.3.2    evaluate_0.19       knitr_1.41         
[31] fastmap_1.1.0       tzdb_0.3.0          fansi_1.0.3        
[34] xlsxjars_0.6.1      pdftools_3.3.2      Rcpp_1.0.9         
[37] readr_2.1.3         openssl_2.0.5       renv_0.16.0        
[40] xlsx_0.6.5          bit_4.0.5           digest_0.6.31      
[43] hms_1.1.2           askpass_1.1         stringi_1.7.8      
[46] openxlsx_4.2.5.1    keyring_1.3.1       dplyr_1.0.10       
[49] rprojroot_2.0.3     here_1.0.1          cli_3.6.0          
[52] odbc_1.3.3          tools_4.2.2         magrittr_2.0.3     
[55] AzureAuth_1.3.3     tibble_3.1.8        pkgconfig_2.0.3    
[58] ellipsis_0.3.2      data.table_1.14.6   xml2_1.3.3         
[61] lubridate_1.9.0     timechange_0.1.1    rmarkdown_2.19     
[64] assertthat_0.2.1    httr_1.4.4          Microsoft365R_2.3.4
[67] officer_0.5.1       rstudioapi_0.14     R6_2.5.1           
[70] compiler_4.2.2     

# Project ============================
Project path: "C:/RStudio_Projects/R_projects/mdTools"

# Status =============================
* The project is already synchronized with the lockfile.

# Packages ===========================
                 Library Source   Lockfile Source Path Dependency
AzureAuth          1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
AzureGraph         1.3.2   CRAN      1.3.2   CRAN  [1]   indirect
DBI                1.1.3   CRAN      1.1.3   CRAN  [1]     direct
KernSmooth       2.23-20   CRAN       <NA>   <NA>  [2]       <NA>
MASS            7.3-58.1   CRAN       <NA>   <NA>  [2]       <NA>
Matrix             1.5-1   CRAN       <NA>   <NA>  [2]       <NA>
Microsoft365R      2.3.4   CRAN      2.3.4   CRAN  [1]     direct
R6                 2.5.1   CRAN      2.5.1   CRAN  [1]   indirect
Rcpp               1.0.9   CRAN      1.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
base64enc          0.1-3   CRAN      0.1-3   CRAN  [1]   indirect
bit                4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
bit64              4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
blob               1.2.3   CRAN      1.2.3   CRAN  [1]   indirect
boot              1.3-28   CRAN       <NA>   <NA>  [2]       <NA>
brew               1.0-8   CRAN       <NA>   <NA>  [1]   indirect
brio               1.1.3   CRAN       <NA>   <NA>  [1]   indirect
bslib              0.4.2   CRAN      0.4.2   CRAN  [1]   indirect
cachem             1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
callr              3.7.3   CRAN       <NA>   <NA>  [1]   indirect
cellranger         1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
class             7.3-20   CRAN       <NA>   <NA>  [2]       <NA>
cli                3.6.0   CRAN      3.6.0   CRAN  [1]   indirect
clipr              0.8.0   CRAN      0.8.0   CRAN  [1]   indirect
cluster            2.1.4   CRAN       <NA>   <NA>  [2]       <NA>
codetools         0.2-18   CRAN       <NA>   <NA>  [2]       <NA>
commonmark         1.8.1   CRAN       <NA>   <NA>  [1]   indirect
cpp11              0.4.3   CRAN      0.4.3   CRAN  [1]   indirect
crayon             1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
credentials        1.3.2   CRAN       <NA>   <NA>  [1]   indirect
curl               4.3.3   CRAN      4.3.3   CRAN  [1]   indirect
data.table        1.14.6   CRAN     1.14.6   CRAN  [1]     direct
desc               1.4.2   CRAN       <NA>   <NA>  [1]   indirect
devtools           2.4.5   CRAN       <NA>   <NA>  [1]     direct
diffobj            0.3.5   CRAN       <NA>   <NA>  [1]   indirect
digest            0.6.31   CRAN     0.6.31   CRAN  [1]   indirect
docxtractr         0.6.5   CRAN      0.6.5   CRAN  [1]     direct
downlit            0.4.2   CRAN       <NA>   <NA>  [1]   indirect
dplyr             1.0.10   CRAN     1.0.10   CRAN  [1]   indirect
ellipsis           0.3.2   CRAN      0.3.2   CRAN  [1]   indirect
evaluate            0.19   CRAN       0.19   CRAN  [1]   indirect
fansi              1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
fastmap            1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
filelock           1.0.2   CRAN      1.0.2   CRAN  [1]   indirect
fontawesome        0.4.0   CRAN       <NA>   <NA>  [1]   indirect
foreign           0.8-83   CRAN       <NA>   <NA>  [2]       <NA>
fs                 1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
generics           0.1.3   CRAN      0.1.3   CRAN  [1]   indirect
gert               1.9.2   CRAN       <NA>   <NA>  [1]   indirect
gh                 1.3.1   CRAN       <NA>   <NA>  [1]   indirect
gitcreds           0.1.2   CRAN       <NA>   <NA>  [1]   indirect
glue               1.6.2   CRAN      1.6.2   CRAN  [1]     direct
grDevices           <NA>   <NA>       <NA>   <NA>  [2]   indirect
graphics            <NA>   <NA>       <NA>   <NA>  [2]   indirect
here               1.0.1   CRAN      1.0.1   CRAN  [1]     direct
highr               0.10   CRAN       0.10   CRAN  [1]   indirect
hms                1.1.2   CRAN      1.1.2   CRAN  [1]   indirect
htmltools          0.5.4   CRAN      0.5.4   CRAN  [1]   indirect
htmlwidgets        1.6.1   CRAN       <NA>   <NA>  [1]   indirect
httpuv             1.6.7   CRAN       <NA>   <NA>  [1]   indirect
httr               1.4.4   CRAN      1.4.4   CRAN  [1]   indirect
ini                0.3.1   CRAN       <NA>   <NA>  [1]   indirect
janitor            2.1.0   CRAN      2.1.0   CRAN  [1]     direct
jose               1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
jquerylib          0.1.4   CRAN      0.1.4   CRAN  [1]   indirect
jsonlite           1.8.4   CRAN      1.8.4   CRAN  [1]   indirect
keyring            1.3.1   CRAN      1.3.1   CRAN  [1]     direct
knitr               1.41   CRAN       1.41   CRAN  [1]     direct
later              1.3.0   CRAN       <NA>   <NA>  [1]   indirect
lattice          0.20-45   CRAN       <NA>   <NA>  [2]       <NA>
lifecycle          1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
lubridate          1.9.0   CRAN      1.9.0   CRAN  [1]   indirect
magrittr           2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
mdTools             <NA>   <NA>       <NA>   <NA>  [1]     direct
memoise            2.0.1   CRAN      2.0.1   CRAN  [1]   indirect
methods             <NA>   <NA>       <NA>   <NA>  [2]   indirect
mgcv              1.8-41   CRAN       <NA>   <NA>  [2]       <NA>
mime                0.12   CRAN       0.12   CRAN  [1]   indirect
miniUI           0.1.1.1   CRAN       <NA>   <NA>  [1]   indirect
nlme             3.1-160   CRAN       <NA>   <NA>  [2]       <NA>
nnet              7.3-18   CRAN       <NA>   <NA>  [2]       <NA>
odbc               1.3.3   CRAN      1.3.3   CRAN  [1]     direct
officer            0.5.1   CRAN      0.5.1   CRAN  [1]     direct
openssl            2.0.5   CRAN      2.0.5   CRAN  [1]   indirect
openxlsx         4.2.5.1   CRAN    4.2.5.1   CRAN  [1]     direct
pdftools           3.3.2   CRAN      3.3.2   CRAN  [1]   indirect
pillar             1.8.1   CRAN      1.8.1   CRAN  [1]   indirect
pkgbuild           1.4.0   CRAN       <NA>   <NA>  [1]   indirect
pkgconfig          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
pkgdown            2.0.7   CRAN       <NA>   <NA>  [1]   indirect
pkgload            1.3.2   CRAN       <NA>   <NA>  [1]   indirect
praise             1.0.0   CRAN       <NA>   <NA>  [1]   indirect
prettyunits        1.1.1   CRAN      1.1.1   CRAN  [1]   indirect
processx           3.8.0   CRAN       <NA>   <NA>  [1]   indirect
profvis            0.3.7   CRAN       <NA>   <NA>  [1]   indirect
progress           1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
promises         1.2.0.1   CRAN       <NA>   <NA>  [1]   indirect
ps                 1.7.2   CRAN       <NA>   <NA>  [1]   indirect
purrr              1.0.0   CRAN      1.0.0   CRAN  [1]   indirect
qpdf               1.3.0   CRAN      1.3.0   CRAN  [1]   indirect
rJava              1.0-6   CRAN      1.0-6   CRAN  [1]   indirect
ragg               1.2.4   CRAN       <NA>   <NA>  [1]   indirect
rappdirs           0.3.3   CRAN      0.3.3   CRAN  [1]   indirect
rcmdcheck          1.4.0   CRAN       <NA>   <NA>  [1]   indirect
re2                0.1.2   CRAN      0.1.2   CRAN  [1]     direct
readr              2.1.3   CRAN      2.1.3   CRAN  [1]     direct
readxl             1.4.1   CRAN      1.4.1   CRAN  [1]     direct
rematch            1.0.1   CRAN      1.0.1   CRAN  [1]   indirect
rematch2           2.1.2   CRAN       <NA>   <NA>  [1]   indirect
remotes            2.4.2   CRAN       <NA>   <NA>  [1]   indirect
renv              0.16.0   CRAN     0.16.0   CRAN  [1]     direct
rlang              1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
rmarkdown           2.19   CRAN       2.19   CRAN  [1]     direct
roxygen2           7.2.3   CRAN       <NA>   <NA>  [1]     direct
rpart             4.1.19   CRAN       <NA>   <NA>  [2]       <NA>
rprojroot          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
rptTools      0.0.0.9000    Git 0.0.0.9000    Git  [1]     direct
rstudioapi          0.14   CRAN       <NA>   <NA>  [1]   indirect
rversions          2.1.2   CRAN       <NA>   <NA>  [1]   indirect
sass               0.4.4   CRAN      0.4.4   CRAN  [1]   indirect
sessioninfo        1.2.2   CRAN       <NA>   <NA>  [1]   indirect
shiny              1.7.4   CRAN       <NA>   <NA>  [1]   indirect
snakecase         0.11.0   CRAN     0.11.0   CRAN  [1]   indirect
sodium             1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
sourcetools        0.1.7   CRAN       <NA>   <NA>  [1]   indirect
spatial           7.3-15   CRAN       <NA>   <NA>  [2]       <NA>
stats               <NA>   <NA>       <NA>   <NA>  [2]   indirect
stringi            1.7.8   CRAN      1.7.8   CRAN  [1]   indirect
stringr            1.5.0   CRAN      1.5.0   CRAN  [1]   indirect
survival           3.4-0   CRAN       <NA>   <NA>  [2]       <NA>
sys                3.4.1   CRAN      3.4.1   CRAN  [1]   indirect
systemfonts        1.0.4   CRAN       <NA>   <NA>  [1]   indirect
testthat           3.1.6   CRAN       <NA>   <NA>  [1]   indirect
textshaping        0.3.6   CRAN       <NA>   <NA>  [1]   indirect
tibble             3.1.8   CRAN      3.1.8   CRAN  [1]   indirect
tidyr              1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
tidyselect         1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
timechange         0.1.1   CRAN      0.1.1   CRAN  [1]   indirect
tinytex             0.43   CRAN       0.43   CRAN  [1]   indirect
tools               <NA>   <NA>       <NA>   <NA>  [2]   indirect
tzdb               0.3.0   CRAN      0.3.0   CRAN  [1]   indirect
urlchecker         1.0.1   CRAN       <NA>   <NA>  [1]   indirect
usethis            2.1.6   CRAN       <NA>   <NA>  [1]   indirect
utf8               1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
utils               <NA>   <NA>       <NA>   <NA>  [2]     direct
uuid               1.1-0   CRAN      1.1-0   CRAN  [1]   indirect
vctrs              0.5.1   CRAN      0.5.1   CRAN  [1]   indirect
vroom              1.6.0   CRAN      1.6.0   CRAN  [1]   indirect
waldo              0.4.0   CRAN       <NA>   <NA>  [1]   indirect
whisker            0.4.1   CRAN       <NA>   <NA>  [1]   indirect
withr              2.5.0   CRAN      2.5.0   CRAN  [1]   indirect
xfun                0.36   CRAN       0.36   CRAN  [1]   indirect
xlsx               0.6.5   CRAN      0.6.5   CRAN  [1]     direct
xlsxjars           0.6.1   CRAN      0.6.1   CRAN  [1]   indirect
xml2               1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
xopen              1.0.0   CRAN       <NA>   <NA>  [1]   indirect
xtable             1.8-4   CRAN       <NA>   <NA>  [1]   indirect
yaml               2.3.6   CRAN      2.3.6   CRAN  [1]   indirect
zip                2.2.2   CRAN      2.2.2   CRAN  [1]   indirect

[1]: C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32
[2]: C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library                             

# ABI ================================
* ABI conflict checks are not yet implemented on Windows.

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

# Settings ===========================
List of 10
 $ bioconductor.version     : chr(0) 
 $ external.libraries       : chr(0) 
 $ ignored.packages         : chr(0) 
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ 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

# Options ============================
List of 9
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : chr "libcurl"
 $ 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.consent                        : logi TRUE
 $ renv.project.path                   : chr "C:/RStudio_Projects/R_projects/mdTools"
 $ renv.verbose                        : logi TRUE

# Environment Variables ==============
HOME                        = C:/Users/dlucey/OneDrive - South Bronx Classical Charter School/Documents
LANG                        = <NA>
MAKE                        = <NA>
R_LIBS                      = <NA>
R_LIBS_SITE                 = C:/PROGRA~1/R/R-42~1.2/site-library
R_LIBS_USER                 = C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32;C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = C:/PROGRA~1/R/R-42~1.2/site-library
RENV_DEFAULT_R_LIBS_USER    = C:\Users\dlucey\AppData\Local/R/win-library/4.2
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PROJECT                = C:/RStudio_Projects/R_projects/mdTools

# PATH ===============================
- C:\RBuildTools\rtools42/x86_64-w64-mingw32.static.posix/bin
- C:\RBuildTools\rtools42/usr/bin
- C:\Program Files\R\R-4.2.2\bin\x64
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0\
- C:\WINDOWS\System32\OpenSSH\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\Program Files\Docker\Docker\resources\bin
- C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
- C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
- C:\Program Files\dotnet\
- C:\ProgramData\chocolatey\bin
- C:\Program Files\Git\cmd
- C:\Users\dlucey\AppData\Local\Microsoft\WindowsApps
- 
- C:\Program Files\RStudio\resources\app\bin\rpostback
- C:\Program Files\RStudio\resources\app\bin\postback
- C:/Program Files/RStudio/resources/app/bin/quarto/bin

# Cache ==============================
There are a total of 294 package(s) installed in the renv cache.
Cache path: "C:/Users/dlucey/AppData/Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32"`\

renv user cache (EDITED)

> renv:::renv_cache_list(packages = "DBI")
[1] "C:\\Users\\dlucey\\AppData\\Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32/DBI/1.1.3/b2866e62bab9378c3cc9476a1954226b/DBI"

System user library (EDITED)

I've read that renv uses symlinks to my main user library where DBI is also installed:

> list.files("C:/Users/dlucey/AppData/Local/R/win-library/4.2")    
    [46] "DBI"               "dbplyr"            "deldir" 
```

  
David Lucey
  • 252
  • 3
  • 9
  • I'd suggest filing a bug report at https://github.com/rstudio/renv/issues (with steps to make a reproducible example if at all possible) – Kevin Ushey Jan 11 '23 at 04:28
  • Thank you for responding, in the end, I don't think it was a renv problem. Some combination of running rcmdcheck::rcmdcheck() and devtools::check(document=FALSE) from the console ultimately fixed it. I was using the "Check" button in the RStudio "Build" tab, which I believe also runs devtools::check(document=FALSE), and it wasn't working. I wish I could exactly pinpoint the exact solution, but advise future users with this problem to try both of those two commands from the console. – David Lucey Jan 19 '23 at 12:59

0 Answers0