rstudio / packrat

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

packrat::init() removes system libraries from .libPaths() #416

Open erblast opened 6 years ago

erblast commented 6 years ago

I dont know if this is intended, since I am just starting to figure out packrat. After I run packrat::init() most of my packages from the system library dissapear and my system libraries are removed from .libPaths(). This of course does not let me load any packages without reinstalling them from CRAN and then packrat wants me to update my system library again.

I run this code on a vanilla project:

.libPaths() dim(installed.packages()) packrat::init() .libPaths() dim(installed.packages()) sessionInfo()

This is is my output. I get more or less the same when running the same code on 64 bit with windows 10. I use the newest Rstudio 1.1.383 on both machines. The same thing happens when I create a new project in Rstudio using the packrat option.

image

kevinushey commented 6 years ago

This is indeed intentional, and it's an extra sandboxing mechanism used by Packrat to help handle cases where users have installed non-system packages in to the system library (as can occur on macOS, where users have write access to the system library by default).

It is a bit frustrating that, for each Packrat project, one must reinstall all packages in use for a project, but it is the design decision we made at the outset.

erblast commented 6 years ago

Ah okay, thanks for clearing that up and for your quick reply I really appreciate it.