ITADN
r-lib/pak/Issues

pak::local_install fails with error "Failed to download package from `file://...`" when devtools::install works well

#867OpenDDorch 创建于 2026-04-24
D
DDorchcommented
On some of my packages I have this weird error: ```r pak::local_install(upgrade = FALSE) ✔ Updated metadata database: 2.78 MB in 2 files. ✔ Updating metadata database ... done → Will update 1 package. → The package (0 B) is cached. + ModeleIntegreAude 0.0.0.9000 → 0.0.0.9000 [bld] ℹ No downloads are needed, 1 pkg is cached ✖ Failed to download ModeleIntegreAude 0.0.0.9000 (source) Error: ! error in pak subprocess Caused by error: ! Failed to download ModeleIntegreAude from `file://C:\\DocDD\\Inrae\\2021-2024 TALANOA\\04-src\\ModeleIntegreAude`. --- Backtrace: 1. pak::local_install(upgrade = FALSE) 2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), … 3. err$throw(res$error) --- Subprocess backtrace: 1. base::withCallingHandlers(cli_message = function(msg) { … 2. get("pkg_install_do_plan", asNamespace("pak"))(...) 3. proposal$stop_for_download_error() 4. private$plan$stop_for_solution_download_error() 5. pkgdepends:::pkgplan_stop_for_solution_download_error(self, private) 6. pkgdepends:::stop(err) 7. | base::throw(add_class(args[[1]], c("rlib_error_3_0", "rlib_error"), … 8. | base::signalCondition(cond) 9. global (function (e) … Execution halted ``` At the same time `devtools::install` works perfectly fine: ```r devtools::install() ── pak::local_install_deps() ────────────────────────────────────────────────────────────────────────── → The package (0 B) is cached. ℹ No downloads are needed ✔ 192 deps: kept 191 [5.8s] ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file 'C:\DocDD\Inrae\2021-2024 TALANOA\04-src\ModeleIntegreAude/DESCRIPTION' ... ─ preparing 'ModeleIntegreAude': (3s) ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts (1.6s) ─ checking for empty or unneeded directories Omitted 'LazyData' from DESCRIPTION NB: this package now depends on R (>= 4.1.0) WARNING: Added dependency on R >= 4.1.0 because package code uses the pipe |> or function shorthand \(...) syntax added in R 4.1.0. File(s) using such syntax: 'generateSSPtimeseries.R' 'load_experiment.R' 'model_usage_drink_ind.R' ─ building 'ModeleIntegreAude_0.0.0.9000.tar.gz' ── R CMD INSTALL ────────────────────────────────────────────────────────────────────────────────────── Running "C:/Users/ddorchies/AppData/Local/Programs/R/R-4.5.1/bin/x64/Rcmd.exe" INSTALL \ "C:\Users\DDORCH~1\AppData\Local\Temp\RtmpcndVDy/ModeleIntegreAude_0.0.0.9000.tar.gz" \ --install-tests * installing to library 'C:/Users/ddorchies/AppData/Local/Programs/R/R-4.5.1/library' * installing *source* package 'ModeleIntegreAude' ... ** this is package 'ModeleIntegreAude' version '0.0.0.9000' ** using staged installation ** R ** inst ** tests ** byte-compile and prepare package for lazy loading Warning: replacing previous import 'TalanoaCommons::extract' by 'tidyr::extract' when loading 'ModeleIntegreAude' ** help *** installing help indices *** copying figures ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location Warning: replacing previous import 'TalanoaCommons::extract' by 'tidyr::extract' when loading 'ModeleIntegreAude' ** testing if installed package can be loaded from final location Warning: replacing previous import 'TalanoaCommons::extract' by 'tidyr::extract' when loading 'ModeleIntegreAude' ** testing if installed package keeps a record of temporary installation path * DONE (ModeleIntegreAude) Warning message: replacing previous import ‘TalanoaCommons::extract’ by ‘tidyr::extract’ when loading ‘ModeleIntegreAude’ ``` I precise that this issue is systematic, it occurs even if all IDEs (Rstudio or Positron, or whatever) are closed and I run the command from a dummy R session without any package loaded. Does anyone meet the same kind of issue?
2 条评论