Skip to content
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

load_all() errors when some packages need to be installed. #261

Closed
olivroy opened this issue Oct 12, 2023 · 3 comments · Fixed by #268
Closed

load_all() errors when some packages need to be installed. #261

olivroy opened this issue Oct 12, 2023 · 3 comments · Fixed by #268

Comments

@olivroy
Copy link
Contributor

olivroy commented Oct 12, 2023

It happened a couple times. It happened when I forked https://github.com/ProjectMOSAIC/mosaic
with usethis::create_from_github("ProjectMOSAIC/mosaic") and then usethis::pr_init("branch") + load_all().

I have library(devtools) loaded if that helps. and had to use setwd() as the package had some weird .Rproj file. But it is unrelated. It happened to me before. Related to #184

I don't really know what may be causing this.

> devtools::load_all("~/rrr-forks/mosaic")
ℹ Loading mosaicThe packages "ggformula", "mosaicData", and "mosaicCore" (>= 0.7.0) are required.Would you like to install them?

1: Yes
2: No

Sélection : 1
Error: 
! error in pak subprocess
Caused by error in `get_remote_types(refs)`:
! Cannot parse package: ~/rrr-forks/mosaic.See `?pkgdepends::pkg_refs()` for supported package sources.
Type .Last.error to see the more details.
> .Last.error.trace
1. devtools::load_all("~/rrr-forks/mosaic")
2. pkgload::load_all(path = path, reset = reset, recompile = recompile, …
3. pkgload:::load_imports(path)
4. pkgload:::deps_check_installed(path, imports)
5. rlang::check_installed(pkg, action = action, call = call)
6. local action(missing_pkgs)
7. pak::pkg_deps(path, upgrade = FALSE)
8. pak:::remote(function(...) { …
9. err$throw(res$error)
Session Info

> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16 ucrt)
 os       Windows 10 x64 (build 19044)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  French_Canada.utf8
 ctype    French_Canada.utf8
 tz       America/Toronto
 date     2023-10-12
 rstudio  2023.09.0-daily+401 Desert Sunflower (desktop)
 pandoc   3.1.1 @ ~/AppData/Local/Programs/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 ! package         * version    date (UTC) lib source
   askpass           1.2.0      2023-09-03 [1] CRAN (R 4.3.1)
   base64enc         0.1-3      2015-07-28 [1] CRAN (R 4.3.0)
   brio              1.1.3      2021-11-30 [1] CRAN (R 4.3.0)
   cachem            1.0.8      2023-05-01 [1] CRAN (R 4.3.0)
   callr             3.7.3      2022-11-02 [1] CRAN (R 4.3.0)
   class             7.3-22     2023-05-03 [2] CRAN (R 4.3.1)
   classInt          0.4-10     2023-09-05 [1] CRAN (R 4.3.1)
   cli               3.6.1      2023-03-23 [1] CRAN (R 4.3.0)
   colorspace        2.1-0      2023-01-23 [1] CRAN (R 4.3.0)
   crayon            1.5.2      2022-09-29 [1] CRAN (R 4.3.0)
   credentials       2.0.1      2023-09-06 [1] CRAN (R 4.3.1)
   curl              5.1.0      2023-10-02 [1] CRAN (R 4.3.1)
   DBI               1.1.3      2022-06-18 [1] CRAN (R 4.3.0)
   desc              1.4.2      2022-09-08 [1] CRAN (R 4.3.0)
   devtools        * 2.4.5      2022-10-11 [1] CRAN (R 4.3.0)
   digest            0.6.33     2023-07-07 [1] CRAN (R 4.3.1)
   dplyr             1.1.3      2023-09-03 [1] CRAN (R 4.3.1)
   e1071             1.7-13     2023-02-01 [1] CRAN (R 4.3.0)
   ellipsis          0.3.2      2021-04-29 [1] CRAN (R 4.3.0)
   evaluate          0.22       2023-09-29 [1] CRAN (R 4.3.1)
   fansi             1.0.5      2023-10-08 [1] CRAN (R 4.3.1)
   fastmap           1.1.1      2023-02-24 [1] CRAN (R 4.3.0)
   fs                1.6.3      2023-07-20 [1] CRAN (R 4.3.1)
   generics          0.1.3      2022-07-05 [1] CRAN (R 4.3.0)
   gert              2.0.0      2023-09-26 [1] CRAN (R 4.3.1)
   ggplot2           3.4.3.9000 2023-10-05 [1] Github (tidyverse/ggplot2@8835709)
   gh                1.4.0      2023-02-22 [1] CRAN (R 4.3.0)
   gitcreds          0.1.2      2022-09-08 [1] CRAN (R 4.3.0)
   glue              1.6.2      2022-02-24 [1] CRAN (R 4.3.0)
   gt                0.10.0     2023-10-07 [1] CRAN (R 4.3.1)
   gtable            0.3.4      2023-08-21 [1] CRAN (R 4.3.1)
   htmltools         0.5.6.1    2023-10-06 [1] CRAN (R 4.3.1)
   htmlwidgets       1.6.2      2023-03-17 [1] CRAN (R 4.3.0)
   httpuv            1.6.11     2023-05-11 [1] CRAN (R 4.3.1)
   httr2             0.2.3      2023-05-08 [1] CRAN (R 4.3.0)
   janitor           2.2.0.9000 2023-08-10 [1] https://sfirke.r-universe.dev (R 4.3.1)
   jsonlite          1.8.7      2023-06-29 [1] CRAN (R 4.3.1)
   KernSmooth        2.23-22    2023-07-10 [1] CRAN (R 4.3.1)
   kit               0.0.15     2023-10-01 [1] CRAN (R 4.3.1)
   knitr             1.44       2023-09-11 [1] CRAN (R 4.3.1)
   later             1.3.1      2023-05-02 [1] CRAN (R 4.3.0)
   lattice           0.21-8     2023-04-05 [2] CRAN (R 4.3.1)
   lifecycle         1.0.3      2022-10-07 [1] CRAN (R 4.3.0)
   lubridate         1.9.3      2023-09-27 [1] CRAN (R 4.3.1)
   magrittr          2.0.3      2022-03-30 [1] CRAN (R 4.3.0)
   MASS              7.3-60     2023-05-04 [2] CRAN (R 4.3.1)
   Matrix            1.6-1.1    2023-09-18 [1] CRAN (R 4.3.1)
   memoise           2.0.1      2021-11-26 [1] CRAN (R 4.3.0)
   mime              0.12       2021-09-28 [1] CRAN (R 4.3.0)
   miniUI            0.1.1.1    2018-05-18 [1] CRAN (R 4.3.0)
 R mosaic            1.8.4.4    <NA>       [?] <NA>
 R mosaicIncubator   1.0        <NA>       [?] <NA>
   munsell           0.5.0      2018-06-12 [1] CRAN (R 4.3.0)
   openssl           2.1.1      2023-09-25 [1] CRAN (R 4.3.1)
   pak               0.6.0      2023-08-31 [1] local
   pillar            1.9.0      2023-03-22 [1] CRAN (R 4.3.0)
   pkgbuild          1.4.2      2023-06-26 [1] CRAN (R 4.3.1)
   pkgconfig         2.0.3      2019-09-22 [1] CRAN (R 4.3.0)
   pkgdown           2.0.7      2022-12-14 [1] CRAN (R 4.3.0)
   pkgload           1.3.3      2023-09-22 [1] CRAN (R 4.3.1)
   prettyunits       1.2.0      2023-09-24 [1] CRAN (R 4.3.1)
   processx          3.8.2      2023-06-30 [1] CRAN (R 4.3.1)
   profvis           0.3.8      2023-05-02 [1] CRAN (R 4.3.0)
   promises          1.2.1      2023-08-10 [1] CRAN (R 4.3.1)
   proxy             0.4-27     2022-06-09 [1] CRAN (R 4.3.0)
   ps                1.7.5      2023-04-18 [1] CRAN (R 4.3.0)
   purrr             1.0.2      2023-08-10 [1] CRAN (R 4.3.1)
   quarto            1.3        2023-09-19 [1] CRAN (R 4.3.1)
   R6                2.5.1      2021-08-19 [1] CRAN (R 4.3.0)
   rappdirs          0.3.3      2021-01-31 [1] CRAN (R 4.3.0)
   Rcpp              1.0.11     2023-07-06 [1] CRAN (R 4.3.1)
   remotes           2.4.2.1    2023-07-18 [1] CRAN (R 4.3.1)
   repr              1.1.6      2023-01-26 [1] CRAN (R 4.3.0)
   reuseme         * 0.0.0.9005 2023-09-29 [1] local
   rlang             1.1.1      2023-04-28 [1] CRAN (R 4.3.0)
   rmarkdown         2.25       2023-09-18 [1] CRAN (R 4.3.1)
   rprojroot         2.0.3      2022-04-02 [1] CRAN (R 4.3.0)
   rstudioapi        0.15.0     2023-07-07 [1] CRAN (R 4.3.1)
   scales            1.2.1      2022-08-20 [1] CRAN (R 4.3.0)
   sessioninfo       1.2.2      2021-12-06 [1] CRAN (R 4.3.0)
   sf                1.0-14     2023-07-11 [1] CRAN (R 4.3.1)
   shiny             1.7.5      2023-08-12 [1] CRAN (R 4.3.1)
   skimr             2.1.5      2022-12-23 [1] CRAN (R 4.3.0)
   snakecase         0.11.1     2023-08-27 [1] CRAN (R 4.3.1)
   stringi           1.7.12     2023-01-11 [1] CRAN (R 4.3.0)
   stringr           1.5.0      2022-12-02 [1] CRAN (R 4.3.0)
   sys               3.4.2      2023-05-23 [1] CRAN (R 4.3.1)
   testthat          3.2.0      2023-10-06 [1] CRAN (R 4.3.1)
   tibble            3.2.1      2023-03-20 [1] CRAN (R 4.3.0)
   tidyr             1.3.0      2023-01-24 [1] CRAN (R 4.3.0)
   tidyselect        1.2.0      2022-10-10 [1] CRAN (R 4.3.0)
   tidyverse         2.0.0      2023-02-22 [1] CRAN (R 4.3.0)
   timechange        0.2.0      2023-01-11 [1] CRAN (R 4.3.0)
   units             0.8-4      2023-09-13 [1] CRAN (R 4.3.1)
   urlchecker        1.0.1      2021-11-30 [1] CRAN (R 4.3.0)
   usethis         * 2.2.2      2023-07-06 [1] CRAN (R 4.3.1)
   utf8              1.2.3      2023-01-31 [1] CRAN (R 4.3.0)
   vctrs             0.6.3      2023-06-14 [1] CRAN (R 4.3.1)
   withr             2.5.1      2023-09-26 [1] CRAN (R 4.3.1)
   xfun              0.40       2023-08-09 [1] CRAN (R 4.3.1)
   xml2              1.3.5      2023-07-06 [1] CRAN (R 4.3.1)
   xtable            1.8-4      2019-04-21 [1] CRAN (R 4.3.0)
   yaml              2.3.7      2023-01-23 [1] CRAN (R 4.3.0)

 [1] ~/AppData/Local/R/win-library/4.3
 [2] C:/Program Files/R/R-4.3.1/library

 R ── Package was removed from disk.

(some paths wiped)
@lionel-
Copy link
Member

lionel- commented Oct 12, 2023

Do you get the same error if you run pak::pak("~/rrr-forks/mosaic")? If so that's either an issue with your package or with pak, in which case we should move the issue there.

@olivroy
Copy link
Contributor Author

olivroy commented Oct 12, 2023

I am pretty sure it would be an issue with pak then. because the prompt is very handy when you do load_all(), it just sometimes doesn't work, and I can't explain why..

maybe it happens only when you don't have the package forked already installed, this happens. If you look at the session info, it says "Package removed from disk"

@olivroy
Copy link
Contributor Author

olivroy commented Jan 24, 2024

@lionel- , I figured it out.

deps <- pak::pkg_deps(path, upgrade = FALSE)

pak::pkg_deps() does not accept a full path.

pkgload (or devtools?) normalizes the path. So even if I call devtools::load_all(".") at the stage of deps_check_installed(), path was expanded to the full path C:/users/path/to/package

I think it could be replaced by pak::local_deps().

Otherwise, would require pak::pkg_deps() to accept a full path, but its documentation does not suggest it can handle a full path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants