pak fails to install specific version; remotes succeeds
pak fails to install terra 1.6.47 with error "[email protected]: Conflicts with [email protected]", but the specified version installs fine using remotes. Also tested on macOS (Sonoma) running R 4.4.1.
Is pak failing due to a conflict between multiple repositories hosting the same package?
pak::pkg_install("[email protected]")
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#>
#> Error: ! error in pak subprocess
#> Caused by error:
#> ! Could not solve package dependencies:
#> * [email protected]: Conflicts with [email protected]
packageVersion("terra")
#> Error in packageVersion("terra"): there is no package called 'terra'
options("repos")
#> $repos
#> P3M
#> "https://packagemanager.posit.co/cran/__linux__/bullseye/latest"
#> CRAN
#> "https://cloud.r-project.org"
Created on 2024-10-10 with reprex v2.1.1
Session info
sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Debian GNU/Linux 11 (bullseye)
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] pak_0.8.0 digest_0.6.37 withr_3.0.1 lifecycle_1.0.4
#> [5] reprex_2.1.1 evaluate_1.0.0 rlang_1.1.4 cli_3.6.3
#> [9] fs_1.6.4 rmarkdown_2.28 tools_4.2.1 glue_1.8.0
#> [13] xfun_0.48 yaml_2.3.10 fastmap_1.2.0 compiler_4.2.1
#> [17] htmltools_0.5.8.1 knitr_1.48
and with remotes:
remotes::install_version("terra", "1.6.47", upgrade = FALSE)
#> Trying https://packagemanager.posit.co/cran/__linux__/bullseye/latest
#> Downloading package from url: https://packagemanager.posit.co/cran/__linux__/bullseye/latest/src/contrib/Archive/terra/terra_1.6-47.tar.gz
#> Installing 1 packages: Rcpp
#> Installing package into '/root/R/x86_64-pc-linux-gnu-library/4.2'
#> (as 'lib' is unspecified)
#> Installing package into '/root/R/x86_64-pc-linux-gnu-library/4.2'
#> (as 'lib' is unspecified)
packageVersion("terra")
#> [1] '1.6.47'
Created on 2024-10-10 with reprex v2.1.1
Session info
sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Debian GNU/Linux 11 (bullseye)
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.37 withr_3.0.1 lifecycle_1.0.4 reprex_2.1.1
#> [5] evaluate_1.0.0 rlang_1.1.4 cli_3.6.3 remotes_2.5.0
#> [9] fs_1.6.4 rmarkdown_2.28 tools_4.2.1 glue_1.8.0
#> [13] xfun_0.48 yaml_2.3.10 fastmap_1.2.0 compiler_4.2.1
#> [17] htmltools_0.5.8.1 knitr_1.48
I think this is probably a bug in pak. It probably happens because the version is actually called 1.6-47 and not 1.6.47. At least 1.6-47 works fine for me in a very similar setup:
> pak::pkg_install("[email protected]")
✔ Loading metadata database ... done
→ Will install 1 package.
→ The package (0 B) is cached.
+ terra 1.6-47 [bld][cmp] + ✔ libgdal-dev, ✔ gdal-bin, ✔ libgeos-dev, ✔ libproj-dev, ✔ libsqlite3-dev
✔ All system requirements are already installed.
Although I can't reproduce what you are seeing, for me it triggers a different error, it installs the latest version:
> pak::pkg_install("[email protected]")
✔ Loading metadata database ... done
→ Will install 1 package.
→ The package (842.88 kB) is cached.
+ terra 1.7-78 [bld][cmp] + ✔ libgdal-dev, ✔ gdal-bin, ✔ libgeos-dev, ✔ libproj-dev, ✔ libsqlite3-dev
✔ All system requirements are already installed.
One way or another, this is a bug. I hope specifying the correct version number works for you as well.
Perhaps related to #583?
I get the same issue. Is there a solution ?
To expand, I'm using pak via renv:
options(renv.config.pak.enabled = TRUE)
renv::install("[email protected]", dependencies = TRUE, prompt = FALSE, lock = TRUE)
If this or a previous version of my_package is installed, I get:
#> ! Could not solve package dependencies:
#> * [email protected]: Conflicts with [email protected]