rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

Unable to retrieve package records for non packages #313

Open jankovicd opened 8 years ago

jankovicd commented 8 years ago

I am trying to deploy a Shiny app to shinyapps.io. The app works perfectly locally but when I try to deploy it I get the following message

Error: Unable to retrieve package records for the following packages:

After some searching and experimenting I have traced it back to packrat. I get the same message when I run packrat::init().

I have done some reading and I understand I should create a local repository for non CRAN packages but the above are not actually packages, they are folders within other packages (Rcpp and XML).

Any idea how I can fix this? I am not an IT expert so apologies if the answer is obvious...

kevinushey commented 8 years ago

If I had to guess, you have the Rcpp sources unpacked somewhere within your project, and when packrat attempts to scour for package dependencies, it discovers the Rcpp unit test files and tries to use those for dependency inference.

What's the output of:

packrat:::appDependencies()
grep("Rcpp", list.files(recursive = TRUE), fixed = TRUE, value = TRUE)

?

jankovicd commented 8 years ago

Thank you for the quick reply! The ouputs you asked about are as follows

packrat:::appDependencies()

Error in eval(expr, envir, enclos) : object 'NOT_CRAN' not found In addition: There were 12 warnings (use warnings() to see them) Error in eval(expr, envir, enclos) : object 'NOT_CRAN' not found Unable to tangle file '\userfs/.../rlibs/3.2.1/packrat/tests/testthat/resources/params-example.Rmd'; cannot parse dependencies [1] "AER" "ALL" "Amelia" [4] "AnnotationDbi" "AnnotationForge" "BB" [7] "BCEA" "BH" "BHH2" [10] "Biobase" "BiocGenerics" "BiocInstaller" [13] "BiocStyle" "Biostrings" "BsMD" [16] "DAAG" "DBI" "DESeq" [19] "DEoptimR" "DT" "Defaults" [22] "DoE.base" "DoseFinding" "Formula" [25] "FrF2" "GLMMGibbs" "GO.db" [28] "GPArotation" "HH" "Hmisc" [31] "IRanges" "ISwR" "Lahman" [34] "LearnBayes" "MCMCpack" "MGLM" [37] "MatchIt" "MatrixModels" "MethComp" [40] "MuMIn" "NMF" "PerformanceAnalytics" [43] "R6" "RApiSerialize" "RColorBrewer" [46] "RCurl" "RGtk2" "RJSONIO" [49] "RSQLite" "RSVGTipsDevice" "RUnit" [52] "RandomFields" "RandomFieldsUtils" "Rcgmin" [55] "Rcmdr" "RcmdrMisc" "Rcpp" [58] "RcppArmadillo" "RcppEigen" "RcppGSL" [61] "RcppRedis" "Rgraphviz" "Rmpfr" [64] "Rvmmin" "SparseM" "Sxslt" [67] "TH.data" "TTR" "TxDb.Hsapiens.UCSC.hg19.knownGene" [70] "VGAM" "XML" "XVector" [73] "Zelig" "abind" "acepack" [76] "agridat" "akima" "annotate" [79] "ape" "asd" "ash" [82] "assertthat" "base64enc" "bdsmatrix" [85] "bit" "bitops" "bread" [88] "breakfast" "caTools" "car" [91] "cellranger" "chron" "coda" [94] "coin" "colorspace" "combinat" [97] "conf.design" "coxme" "crayon" [100] "curl" "data.table" "deldir" [103] "devtools" "dfoptim" "dichromat" [106] "digest" "doMC" "doParallel" [109] "dplyr" "dse1" "e1071" [112] "eha" "estimability" "evaluate" [115] "expm" "fBasics" "fTrading" [118] "fastICA" "ff" "fields" [121] "fitdistrplus" "foo" "foreach" [124] "forecast" "formatR" "fracdiff" [127] "gWidgetsWWW2" "gam" "gamair" [130] "gdata" "gee" "geepack" [133] "genefilter" "geoR" "ggplot2" [136] "ggthemes" "git2r" "glm2" [139] "gmp" "golubEsets" "googlesheets" [142] "gridBase" "gridExtra" "gsDesign" [145] "gss" "gtable" "gtools" [148] "hdrcde" "hgu95av2" "hgu95av2.db" [151] "highlight" "highr" "hom.Hs.inp.db" [154] "htmltools" "htmlwidgets" "httpuv" [157] "httr" "hwriter" "ibdreg" [160] "igraph" "inline" "irlba" [163] "iterators" "jsonlite" "kernlab" [166] "knitr" "ks" "labeling" [169] "latticeExtra" "lazyeval" "leaps" [172] "lme4" "lme4.0" "lmtest" [175] "locfit" "lsmeans" "magrittr" [178] "maps" "markdown" "maxLik" [181] "mc2d" "mcmc" "mcr" [184] "mda" "memoise" "meta" [187] "microbenchmark" "mime" "minqa" [190] "misc3d" "miscTools" "mlogit" [193] "modeltools" "msm" "multcomp" [196] "multicool" "multtest" "munsell" [199] "mvtnorm" "mvtnormAPI" "nloptr" [202] "numDeriv" "nycflights13" "oatmeal" [205] "openssl" "optextras" "optimx" [208] "org.At.tair.db" "org.Bt.eg.db" "org.Ce.eg.db" [211] "org.Cf.eg.db" "org.Dm.eg.db" "org.Dr.eg.db" [214] "org.EcK12.eg.db" "org.EcSakai.eg.db" "org.Gg.eg.db" [217] "org.Hs.eg.db" "org.Mm.eg.db" "org.Rn.eg.db" [220] "org.Sc.sgd.db" "org.Ss.eg.db" "org.Xl.eg.db" [223] "org.testing.db" "packrat" "pasilla" [226] "pkgmaker" "plm" "plyr" [229] "polspline" "praise" "proto" [232] "pryr" "purrr" "quadprog" [235] "quantmod" "quantreg" "rae230a.db" [238] "rae230aprobe" "randomForest" "raster" [241] "rbenchmark" "reactome.db" "readr" [244] "registry" "reshape" "reshape2" [247] "rggobi" "rgl" "rjson" [250] "rmarkdown" "rngtools" "robustbase" [253] "rredis" "rriskDistributions" "rstudioapi" [256] "sandwich" "scales" "scatterplot3d" [259] "setRNG" "sfsmisc" "shiny" [262] "shinythemes" "snow" "sp" [265] "spam" "spdep" "sphet" [268] "splancs" "splm" "stabledist" [271] "stargazer" "statmod" "stringi" [274] "stringr" "strucchange" "survey" [277] "svUnit" "tcltk2" "testRcppClass" [280] "testRcppModule" "testthat" "tibble" [283] "tidyr" "timeDate" "timeSeries" [286] "tkrplot" "tree" "triangle" [289] "tseries" "ucminf" "unmarked" [292] "urca" "uroot" "vars" [295] "vcd" "whisker" "withr" [298] "xgobi" "xml2" "xtable" [301] "xts" "yags" "yaml" [304] "zoo" There were 50 or more warnings (use warnings() to see the first 50) warnings() Warning messages: 1: In value[3L] : Failed to parse \userfs/.../rlibs/3.1.0/RCurl/examples/CIS/cis.R ; dependencies in this file will not be discovered. 2: In value[3L] : Failed to parse \userfs/.../rlibs/3.2.1/Biobase/Code/R/get@PKGNAME@.R ; dependencies in this file will not be discovered. 3: In fileDependencies.R(tempfile) : No file at path 'C:\Users....\AppData\Local\Temp\RtmpgfYFON\file9ec3f317c99'. 4: In FUN(X[[i]], ...) : Package 'annotate' not available in repository or locally 5: In FUN(X[[i]], ...) : Package 'hgu95av2.db' not available in repository or locally

And another 45+ warnings about packages not being available in repository or locally....

grep("Rcpp", list.files(recursive = TRUE), fixed = TRUE, value = TRUE) Gives me 1675 lines long output, a selection of randon 20 is

[1000] "R/win-library/3.2/RcppEigen/libs/i386/symbols.rds" [1001] "R/win-library/3.2/RcppEigen/libs/x64/RcppEigen.dll" [1002] "R/win-library/3.2/RcppEigen/libs/x64/symbols.rds" [1003] "R/win-library/3.2/RcppEigen/LICENSE" [1004] "R/win-library/3.2/RcppEigen/MD5" [1005] "R/win-library/3.2/RcppEigen/Meta/hsearch.rds" [1006] "R/win-library/3.2/RcppEigen/Meta/links.rds" [1007] "R/win-library/3.2/RcppEigen/Meta/nsInfo.rds" [1008] "R/win-library/3.2/RcppEigen/Meta/package.rds" [1009] "R/win-library/3.2/RcppEigen/Meta/Rd.rds" [1010] "R/win-library/3.2/RcppEigen/Meta/vignette.rds" [1011] "R/win-library/3.2/RcppEigen/NAMESPACE" [1012] "R/win-library/3.2/RcppEigen/NEWS.Rd" [1013] "R/win-library/3.2/RcppEigen/R/RcppEigen" [1014] "R/win-library/3.2/RcppEigen/R/RcppEigen.rdb" [1015] "R/win-library/3.2/RcppEigen/R/RcppEigen.rdx" [1016] "R/win-library/3.2/RcppEigen/skeleton/Makevars" [1017] "R/win-library/3.2/RcppEigen/skeleton/Makevars.win" [1018] "R/win-library/3.2/RcppEigen/skeleton/rcppeigen_hello_world.cpp" [1019] "R/win-library/3.2/RcppEigen/skeleton/rcppeigen_hello_world.Rd" [1020] "R/win-library/3.2/RcppEigen/unitTests/runit.fastLm.R"

They all look like this...

Does that help at all?

On 20 July 2016 at 18:05, Kevin Ushey notifications@github.com wrote:

If I had to guess, you have the Rcpp sources unpacked somewhere within your project, and when packrat attempts to scour for package dependencies, it discovers the Rcpp unit test files and tries to use those for dependency inference.

What's the output of:

packrat:::appDependencies() grep("Rcpp", list.files(recursive = TRUE), fixed = TRUE, value = TRUE)

?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rstudio/packrat/issues/313#issuecomment-234014046, or mute the thread https://github.com/notifications/unsubscribe-auth/ATkSei48VlI7u8hWJBq_Jmjok10oiiXKks5qXlVOgaJpZM4JQxfv .

kevinushey commented 8 years ago

What directory are you trying to initialize packrat in? It seems like this might be your home directory, or perhaps a directory with a symlink / directory shortcut to your home directory? If so, packrat is not going to function well (it's going to attempt to crawl your entire home directory, recursively, for package dependencies).

jankovicd commented 8 years ago

Oh, sorry I ran appDependencies for the wrong library by accident. Here is what I get when I run it for the app only:

packrat:::appDependencies() [1] "BH" "DBI" "Defaults" "R6" "RApiSerialize" "RColorBrewer" [7] "RUnit" "Rcpp" "RcppArmadillo" "RcppGSL" "RcppRedis" "TTR" [13] "assertthat" "base64enc" "bitops" "caTools" "chron" "colorspace" [19] "curl" "data.table" "dichromat" "digest" "dplyr" "evaluate" [25] "foo" "formatR" "ggplot2" "gtable" "highlight" "highr" [31] "htmltools" "httpuv" "httr" "inline" "jsonlite" "knitr" [37] "labeling" "lazyeval" "magrittr" "markdown" "mime" "miniUI" [43] "munsell" "openssl" "packrat" "plyr" "proto" "quantmod" [49] "rbenchmark" "rdrop2" "reshape2" "rmarkdown" "rredis" "scales" [55] "shiny" "shinyjs" "stringr" "testRcppClass" "testRcppModule" "tibble" [61] "xtable" "xts" "yaml" "zoo" Warning messages: 1: In FUN(X[[i]], ...) : Package 'testRcppClass' not available in repository or locally 2: In FUN(X[[i]], ...) : Package 'foo' not available in repository or locally 3: In FUN(X[[i]], ...) : Package 'testRcppModule' not available in repository or locally

grep("Rcpp", list.files(recursive = TRUE), fixed = TRUE, value = TRUE) output is the same.

On 21 July 2016 at 18:04, Kevin Ushey notifications@github.com wrote:

What directory are you trying to initialize packrat in? It seems like this might be your home directory, or perhaps a directory with a symlink / junction point to your home directory? If so, packrat is not going to function well (it's going to attempt to crawl your entire home directory, recursively, for package dependencies).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rstudio/packrat/issues/313#issuecomment-234318191, or mute the thread https://github.com/notifications/unsubscribe-auth/ATkSenxbVq0bXZvcqKFabztoBsBY8_yvks5qX6asgaJpZM4JQxfv .

jankovicd commented 8 years ago

If it is the case that Rcpp is sourced unpacked within the project as you predicted, and packrat is trying to use Rcpp unit test files for dependency interface, do you have any idea how I may be able to fix this?

Would it help if I provide the entire code?

Any help would be greatly appreciated...

On 22 July 2016 at 09:51, Dina Jankovic dina.jankovic@york.ac.uk wrote:

Oh, sorry I ran appDependencies for the wrong library by accident. Here is what I get when I run it for the app only:

packrat:::appDependencies() [1] "BH" "DBI" "Defaults" "R6" "RApiSerialize" "RColorBrewer" [7] "RUnit" "Rcpp" "RcppArmadillo" "RcppGSL" "RcppRedis" "TTR" [13] "assertthat" "base64enc" "bitops" "caTools" "chron" "colorspace" [19] "curl" "data.table" "dichromat" "digest" "dplyr" "evaluate" [25] "foo" "formatR" "ggplot2" "gtable" "highlight" "highr" [31] "htmltools" "httpuv" "httr" "inline" "jsonlite" "knitr" [37] "labeling" "lazyeval" "magrittr" "markdown" "mime" "miniUI" [43] "munsell" "openssl" "packrat" "plyr" "proto" "quantmod" [49] "rbenchmark" "rdrop2" "reshape2" "rmarkdown" "rredis" "scales" [55] "shiny" "shinyjs" "stringr" "testRcppClass" "testRcppModule" "tibble" [61] "xtable" "xts" "yaml" "zoo" Warning messages: 1: In FUN(X[[i]], ...) : Package 'testRcppClass' not available in repository or locally 2: In FUN(X[[i]], ...) : Package 'foo' not available in repository or locally 3: In FUN(X[[i]], ...) : Package 'testRcppModule' not available in repository or locally

grep("Rcpp", list.files(recursive = TRUE), fixed = TRUE, value = TRUE) output is the same.

On 21 July 2016 at 18:04, Kevin Ushey notifications@github.com wrote:

What directory are you trying to initialize packrat in? It seems like this might be your home directory, or perhaps a directory with a symlink / junction point to your home directory? If so, packrat is not going to function well (it's going to attempt to crawl your entire home directory, recursively, for package dependencies).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rstudio/packrat/issues/313#issuecomment-234318191, or mute the thread https://github.com/notifications/unsubscribe-auth/ATkSenxbVq0bXZvcqKFabztoBsBY8_yvks5qX6asgaJpZM4JQxfv .

HenrikEckermann commented 6 years ago

@jankovicd : Did you find a solution for this? It seems like I have a similar issue. I use the newest dev version of Packrat and get the same error when I try to create a snapshot:

Error: Unable to retrieve package records for the following packages:
- 'RcppEigen'

EDIT: If I install RccpEigen from CRAN it throughs then the same error for the package BH and no longer for RccpEigen. If I then install BH, I get the error for the package plogr, then RcppArmadillo and finally for GO.db. When I want to install GO.db I get a warning during installation that it is only available as source package and not as binary for R 3.5.1.

After that I tried snapshot() again but the error for GO.db remains and this where I don't know further for now. I tried packrat::opts$ignored.packages("..1") without success.

Output of addDependencies:

> packrat:::appDependencies()
  [1] "BH"             "Biobase"        "BiocGenerics"   "BiocInstaller" 
  [5] "Biostrings"     "DBI"            "HITChipDB"      "IRanges"       
  [9] "MASS"           "MatrixModels"   "R6"             "RColorBrewer"  
 [13] "RMySQL"         "RPA"            "Rcpp"           "RcppEigen"     
 [17] "Rhdf5lib"       "S4Vectors"      "SparseM"        "XVector"       
 [21] "abind"          "ade4"           "afex"           "affy"          
 [25] "affyio"         "ape"            "arules"         "assertthat"    
 [29] "bindr"          "bindrcpp"       "biomformat"     "bitops"        
 [33] "caTools"        "car"            "carData"        "cellranger"    
 [37] "cli"            "colorspace"     "cowplot"        "crayon"        
 [41] "curl"           "data.table"     "dendsort"       "devtools"      
 [45] "dichromat"      "digest"         "dplyr"          "emmeans"       
 [49] "estimability"   "fansi"          "forcats"        "foreach"       
 [53] "gdata"          "ggfortify"      "ggplot2"        "ggrepel"       
 [57] "ggsignif"       "ggvegan"        "git2r"          "glue"          
 [61] "gplots"         "gridExtra"      "gtable"         "gtools"        
 [65] "haven"          "hms"            "httr"           "igraph"        
 [69] "iterators"      "jsonlite"       "labeling"       "lazyeval"      
 [73] "lme4"           "lmerTest"       "magrittr"       "maptools"      
 [77] "memoise"        "microbiome"     "mime"           "minqa"         
 [81] "misc3d"         "multtest"       "munsell"        "mvtnorm"       
 [85] "nloptr"         "numDeriv"       "openssl"        "openxlsx"      
 [89] "packrat"        "pbkrtest"       "permute"        "pheatmap"      
 [93] "phyloseq"       "pillar"         "pkgconfig"      "plogr"         
 [97] "plot3D"         "plyr"           "preprocessCore" "purrr"         
[101] "quantreg"       "readr"          "readxl"         "rematch"       
[105] "reshape"        "reshape2"       "rhdf5"          "rio"           
[109] "rlang"          "rstudioapi"     "scales"         "sp"            
[113] "stringi"        "stringr"        "tibble"         "tidyr"         
[117] "tidyselect"     "utf8"           "vegan"          "viridisLite"   
[121] "whisker"        "withr"          "xtable"         "zip"           
[125] "zlibbioc"  
grep("GO.db", list.files(recursive = TRUE), fixed = TRUE, value = TRUE)
character(0)

I tested the same for RccpEigen after installation and it also returns character(0).

jankovicd commented 6 years ago

When I had the issue I left it for a couple of weeks and when I came back to it it worked. I'm sorry, I know that doesn't help you at all...