Closed czeildi closed 5 years ago
Related issue: https://github.com/rstudio/packrat/issues/65
It does not explain the error, but you may have less issues with remotes::install_github
because it has less dependencies to other 📦 .
packrat::with_extlib(
"remotes",
install_github("r-lib/pkgdown")
)
There seems to be something off with .onLoad
call, I have a similar with some simple example.
tempdir <- tempfile()
dir.create(tempdir)
setwd(tempdir)
packrat::init(restart = FALSE)
#> Initializing packrat project in directory:
#> - "C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac"
#>
#> Adding these packages to packrat:
#> _
#> packrat 0.4.9-3
#> Fetching sources for packrat (0.4.9-3) ...
#> OK (CRAN current)
#> Snapshot written to "C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac/packrat/packrat.lock"
#> Installing packrat (0.4.9-3) ...
#> OK (downloaded binary)
#> Initialization complete!
.libPaths()
#> [1] "C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac/packrat/lib/x86_64-w64-mingw32/3.5.1"
#> [2] "C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac/packrat/lib-ext/x86_64-w64-mingw32/3.5.1"
#> [3] "C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac/packrat/lib-R/x86_64-w64-mingw32/3.5.1"
devtools::install_github("r-lib/glue")
#> Error in loadNamespace(name): aucun package nommé 'devtools' n'est trouvé
packrat::with_extlib("devtools",
install_github("tidyverse/glue")
)
#> Error: package or namespace load failed for 'devtools':
#> .onLoad a échoué dans loadNamespace() pour 'processx', détails :
#> appel : loadNamespace(name)
#> erreur : aucun package nommé 'ps' n'est trouvé
packrat::with_extlib("remotes",
install_github("tidyverse/glue")
)
#> Downloading GitHub repo tidyverse/glue@master
#> Running `R CMD build`...
#> * checking for file 'C:\Users\chris\AppData\Local\Temp\RtmpkVdJ4G\remotes11ae05f6662c6\tidyverse-glue-35c61e9/DESCRIPTION' ... OK
#> * preparing 'glue':
#> * checking DESCRIPTION meta-information ... OK
#> * cleaning src
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building 'glue_1.3.0.tar.gz'
#> Installing package into 'C:/Users/chris/AppData/Local/Temp/RtmpkVdJ4G/file11ae01d2d24ac/packrat/lib/x86_64-w64-mingw32/3.5.1'
#> (as 'lib' is unspecified)
#> [1] "glue"
for reprex with packrat, reprex::reprex(advertise = FALSE)
can help.
I have a similar problem. Actually, I cannot use devtools from inside a project using packrat:
> library(packrat)
> extlib("devtools")
Erreur : package or namespace load failed for ‘devtools’:
.onLoad failed in loadNamespace() for 'pkgload', details:
call: loadNamespace(name)
error: there is no package called ‘desc’
Actually, it only works if I I load devtools dependencies outside my packrat library like this: extlib(c("desc", "usethis", "devtools"))
Due to a change in packrat 0.5.0, the example above are no more working. This one which was working correctly does not anymore because with_extlib
changes .libPaths()
now.
packrat::with_extlib("remotes",
install_github("tidyverse/glue")
)
will install glue but in user libpath, not packrat project libpath.
Thanks @cderv , indeed the behavior and issues are quite different w packrat 0.5.0 , without you I did not realize there was a new CRAN release of packrat.
I will close this issue as I believe #517 is more focused and up to date.
I cannot install using devtools in a packrat project unless I install devtools within the project which seems unnecessary for running 1 command,
install_github
.I am not sure if this is a
packrat
orpkgload
issue:I ran the following in a completely new project, the only previous command was
packrat::init()
devtools::install_github
works fine after installing devtools within the project.The above is a manual "reprex" as it seems reprex and packrat does not work well together, with running reprex on the above script, installation worked fine.
I suspect the following part of
pkgload
is related but I am not sure: https://github.com/r-lib/pkgload/blob/0ef4f58cd8135e9e77c21243e466b9739e608bde/R/zzz.r#L1Any pointers would be appreciated! thanks
reprex output:
Created on 2018-11-11 by the reprex package (v0.2.0).
reprex output 2:
If I start my code example with
packrat::init()
Created on 2018-11-11 by the reprex package (v0.2.0).