-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error adding packrat to existing project on MacOSX #314
Comments
Thanks -- the warnings can be ignored, but we should definitely suppress the ones related to |
This bit:
looks like an error due to us detecting something like an empty |
Did anybody happen to find an issue for this:
|
I would also like to know if there is any progress on this? No matter how do I set the options in
|
If you could provide a reproducible example, that would greatly help us figure out what's going on. |
I can't. I reinstalled everything...R, RStudio, packrat, packages, etc., and now everything is working. Sorry I can't be of more help. |
I somehow managed to overcome this problem by reverting back to a former version of the project (although I still don't understand what was the cause of the error). Now I am getting another error as following for the sp and rgdal packages, looks like has to do with the package dependencies.
I am using RStudio Server on Amazon EC2 instance. I have multiple R projects and for some of them packrat works perfectly fine, but for most of them it does not. Here is the output of the sessionInfo for this specific project:
|
I start to wonder where the packages are attached from in the section |
I'm also surprised that some of these packages appear to be getting attached while they are installed -- that seems unintended on Packrat's part. (I know that Packrat attempts to detect if the package you're attempting to install is currently attached, and detaches + unloads it if possible, so there may be something going awry in that code path) Does it make a difference if you try restoring this project using the current development version of Packrat? |
I uninstalled packrat and reinstalled the development version using
However,
So you see that |
The error here is different from the one you reported in the earlier bit re: Is there any chance you can get an R traceback here? E.g. |
Code example: https://github.com/tosaddler/plate-viewer (deleted the old packrat folder and created from scratch). I'm getting the same error. None of my bundles work w/ the current project. When I try to rebuild from scratch, I get the error above:
|
@shapiromatron are you willing to share one of these bundles so I can try to reproduce the issue you're encountering? Or can you provide any other steps that I can follow to reproduce? |
Here's how to recreate, using a new instance of packrat: cd ~/dev/tmp
git clone https://github.com/tosaddler/plate-viewer
cd plate-viewer && rm -rf packrat
R -e "packrat::init()" The reason I create a new one is the bundles don't work when I try to use them in shiny-server. After restoring (and turning packrat on) i get an error about libraries being unavailable, even though they're restored. |
@shapiromatron, that works fine for me using the development version of Packrat currently on GitHub. (It is, though, quite slow given the number of packages that need to be installed.) If you haven't already, can you try this using the development version of Packrat?
|
Nope @kevinushey; still fails: In bash: cd ~/dev/tmp
git clone https://github.com/tosaddler/plate-viewer
cd plate-viewer && rm -rf packrat
R In R: > devtools::install_github("rstudio/packrat")
Skipping install of 'packrat' from a github remote, the SHA1 (9492e748) has not changed since last install.
Use `force = TRUE` to force installation
> packrat::init()
Initializing packrat project in directory:
- "~/dev/temp/plate-viewer"
Error in isNamespaceLoaded(pkg) :
attempt to use zero-length variable name
In addition: Warning message:
In FUN(X[[i]], ...) : Package '' not available in repository or locally |
I'm still not able to reproduce using the code you've supplied. :-/ What is the output of |
If I may add here since I am still getting the same error as well, here is the output of
Does it have to do with the first element, which is basically an empty character? |
@kevinushey sorry for the delay, it's as you'd expect I think: > packrat:::appDependencies()
[1] "" "BH" "DBI" "DEoptimR"
[5] "DT" "R6" "RColorBrewer" "Rcpp"
[9] "TSP" "assertthat" "base64enc" "bitops"
[13] "broom" "caTools" "cellranger" "colorspace"
[17] "crosstalk" "curl" "data.table" "dendextend"
[21] "dichromat" "digest" "diptest" "dplyr"
[25] "flexmix" "forcats" "foreach" "fpc"
[29] "gclus" "gdata" "ggplot2" "gplots"
[33] "gridExtra" "gtable" "gtools" "haven"
[37] "heatmaply" "hexbin" "hms" "htmltools"
[41] "htmlwidgets" "httpuv" "httr" "iterators"
[45] "jsonlite" "kernlab" "labeling" "lazyeval"
[49] "lubridate" "magrittr" "mclust" "mime"
[53] "modelr" "modeltools" "munsell" "mvtnorm"
[57] "openssl" "packrat" "plotly" "plyr"
[61] "prabclus" "psych" "purrr" "qap"
[65] "readr" "readxl" "registry" "rematch"
[69] "reshape2" "rlang" "robustbase" "rvest"
[73] "scales" "selectr" "seriation" "shiny"
[77] "shinyHeatmaply" "sourcetools" "stringi" "stringr"
[81] "tibble" "tidyr" "tidyverse" "trimcluster"
[85] "viridis" "viridisLite" "whisker" "xml2"
[89] "xtable" "yaml"
Warning message:
In FUN(X[[i]], ...) : Package '' not available in repository or locally |
The fact that an empty element is showing up there is surprising to me, so I'd like to know where that's coming from if possible. I can also explicitly work around it in Packrat as well, but it'd be good to know the underlying cause. |
Thanks, anything we can do to help? R isn't my specialty; I'm doing devops using packrat to manage dependencies for a shiny-server. |
If you can debug and step through the call to I've just updated Packrat to drop empty package names that happen to enter here -- this is ultimately a bandaid but should hopefully help unblock you here. |
After installing the development package, now I get the following error:
|
Yep, I get the same error: > packrat::init()
Initializing packrat project in directory:
- "~/dev/temp/plate-viewer"
Error: Unable to retrieve package records for the following packages:
- 'DEoptimR', 'DT', 'TSP', 'base64enc', 'broom', 'caTools', 'crosstalk', 'data.table', 'dendextend', 'diptest', 'flexmix', 'forcats', 'fpc', 'gclus', 'gdata', 'gplots', 'gridExtra', 'gtools', 'haven', 'heatmaply', 'hexbin', 'hms', 'htmlwidgets', 'kernlab', 'lubridate', 'mclust', 'modelr', 'plotly', 'prabclus', 'psych', 'purrr', 'qap', 'readr', 'robustbase', 'rvest', 'selectr', 'seriation', 'shinyHeatmaply', 'tidyr', 'tidyverse', 'trimcluster', 'viridis', 'viridisLite'
In addition: There were 44 warnings (use warnings() to see them) |
What is the output of |
On my side:
and
|
> getOption("repos")
CRAN
"@CRAN@"
> warnings()
NULL So then I set one: > getOption("repos")
CRAN
"http://cran.cnr.berkeley.edu/"
> warnings()
Warning messages:
1: In FUN(X[[i]], ...) : Package '' not available in repository or locally
2: In FUN(X[[i]], ...) :
Failed to infer source for package 'DEoptimR'; using latest available version on CRAN instead
3: In FUN(X[[i]], ...) :
Failed to infer source for package 'DT'; using latest available version on CRAN instead
4: In FUN(X[[i]], ...) :
Failed to infer source for package 'TSP'; using latest available version on CRAN instead
5: In FUN(X[[i]], ...) :
Failed to infer source for package 'base64enc'; using latest available version on CRAN instead
.... |
Okay, I can finally reproduce this. It looks like an unfortunately silly bug on Packrat's end. I'll try to get this fixed up shortly! |
Thanks Kevin for working with us and getting this patched, I hope we've
been helpful in helping you diagnose!
|
You've been very helpful! Thanks for your persistence in helping me nail this down. |
I also appreciate your efforts Kevin for working this out. I was wondering if you already managed to fix the issue as I already see you made a commit? I am getting the following error at the moment:
|
Can you please run that again with |
I get
In the output of
|
Any chance you can post your application publicly, so I can try to reproduce? |
Hi @kevinushey I'm getting the same issues on my project which is public: > getOption("repos")
CRAN
"https://mirrors.nics.utk.edu/cran/"
> options(error = traceback)
> packrat::init()
Initializing packrat project in directory:
- "~/dev/temp/plate-viewer"
Error in isNamespaceLoaded(pkg) :
attempt to use zero-length variable name
In addition: There were 47 warnings (use warnings() to see them)
No traceback available
> packrat:::appDependencies()
[1] "BH" "DBI" "DEoptimR" "DT"
[5] "R6" "RColorBrewer" "Rcpp" "TSP"
[9] "assertthat" "base64enc" "bitops" "broom"
[13] "caTools" "cellranger" "colorspace" "crosstalk"
[17] "curl" "data.table" "dendextend" "dichromat"
[21] "digest" "diptest" "dplyr" "flexmix"
[25] "forcats" "foreach" "fpc" "gclus"
[29] "gdata" "ggplot2" "gplots" "gridExtra"
[33] "gtable" "gtools" "haven" "heatmaply"
[37] "hexbin" "hms" "htmltools" "htmlwidgets"
[41] "httpuv" "httr" "iterators" "jsonlite"
[45] "kernlab" "labeling" "lazyeval" "lubridate"
[49] "magrittr" "mclust" "mime" "modelr"
[53] "modeltools" "munsell" "mvtnorm" "openssl"
[57] "packrat" "plotly" "plyr" "prabclus"
[61] "psych" "purrr" "qap" "readr"
[65] "readxl" "registry" "rematch" "reshape2"
[69] "rlang" "robustbase" "rvest" "scales"
[73] "selectr" "seriation" "shiny" "shinyHeatmaply"
[77] "sourcetools" "stringi" "stringr" "tibble"
[81] "tidyr" "tidyverse" "trimcluster" "viridis"
[85] "viridisLite" "whisker" "xml2" "xtable"
[89] "yaml"
Warning message:
In FUN(X[[i]], ...) : Package '' not available in repository or locally |
Thank you @shapiromatron for sharing your project, as my application is used for commercial purposed and I needed to go through administration process to be able to share it, which would normally take much longer! Let's hope that @kevinushey would be able to reproduce the error with your project. |
Oh yeah, I forgot to show the warnings. They were like the ones above... In FUN(X[[i]], ...) :
Failed to infer source for package 'DEoptimR'; using latest available version on CRAN instead |
The warnings here can be safely ignored, and I still cannot reproduce the One last thing to try -- can you try running: trace(isNamespaceLoaded, quote({
calls <- capture.output(sys.calls())
writeLines(calls, "~/rstudio-trace.txt")
}))
packrat::init() Hopefully, when the error occurs, you will get a stack trace written to the file at |
Here you go:
|
Can you try running it in a plain R session (outside of RStudio)? Unfortunately RStudio is executing |
Sorry, I wasn't sure what to expect from the output. Here is the output when running in R, hope this one helps!
|
@alisol86 what is the output of
It seems like, on your system, Packrat is still picking up |
Hi all ! I've the same problem. While running : I get the following error :
Here is the result of :
here are my session info : locale: attached base packages: loaded via a namespace (and not attached): Also, I've noticed that while I run : An .Rprofile appears in my Working Directory and immediately disappears. I hope that helps to solve the problem... many thanks for your support ! EDIT : |
@kevinushey: I check my packrat version through:
I assume this is the development version, right? Also now I get the same error as before and the content of rstudio-trace.txt is same as before (#314 (comment)).
However, when I do the same in RStudio, I get the following packages with the warning
Sorry if I am posting a lot of information. I tried to put as much relevant outputs as possible and I hope this will help you to find the problem. |
I've tried to put another bandaid here, but unfortunately I still can't reproduce this locally, and until I can I won't be able to make a fix with any confidence 😕 |
@kevinushey I am not sure if you already changed something, but with the latest version on github
Any ideas on this? |
I am not sure if this is linked to directories, but if I look at the error message, it seems that packrat sometimes looks into different directories. Here is the output of libPaths() in my project:
And packrat seems to be installing the package in |
You might try manually installing the install.packages("mnormt")
packrat::init() I'm not sure why > tools::package_dependencies("psych")
$psych
[1] "mnormt" "parallel" "stats" "graphics"
[5] "grDevices" "methods" "foreign" "lattice"
[9] "nlme" Could potentially be a Packrat issue? |
@kevinushey Many thanks for your persistence and great work, I finally managed to run packrat for my project! I encountered couple of other errors which were linked to package installation, but with the current development version, everything worked for me! I really enjoyed the discussions we had and I really appreciate your help. I wish you best of luck with your future endeavors with Packrat! 👍😃 |
I get the same thing Installing sp (1.3-1) ... No clue how to fix it. It will not create the lock file. |
me2 |
I get an error when trying to add packrat to my existing project on MacOSX 10.11 and latest R installed from homebrew. The project is available here: https://github.com/alepulver/my-thesis
The text was updated successfully, but these errors were encountered: