r-lib / conflicted

An alternative conflict resolution strategy for R
https://conflicted.r-lib.org/
Other
248 stars 14 forks source link

error: could not find function "validate_key" #61

Closed mvaudel closed 2 years ago

mvaudel commented 3 years ago

Hi,

Thank you for developing and maintaining this fantastic package.

I am encountering an issue when calling library("conflicted", lib = libFolder).

Error: package or namespace load failed for ‘conflicted’:
 .onAttach failed in attachNamespace() for 'conflicted', details:
  call: validate_key(key)
  error: could not find function "validate_key"

I updated memoise and conflicted, and loaded memoise prior to conflicted, but this did not help.

I am working on a constrained setup where R needs to run in a conda environment and libraries need to be stored in a preset folder, I am not sure whether this is causing the issue. Would you have an idea on how to avoid this error?

Many thanks for your help,

Marc

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS/LAPACK: /home/me/mambaforge/envs/R_4.1/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
 [1] grid      parallel  splines   stats     graphics  grDevices utils
 [8] datasets  methods   base

other attached packages:
 [1] cachem_1.0.6      memoise_2.0.0     gtable_0.3.0      scico_1.2.0
 [5] ggplot2_3.3.5     reshape2_1.4.4    digest_0.6.28     labeling_0.4.2
 [9] withr_2.4.2       gamlss_5.3-4      gamlss.dist_5.3-2 gamlss.data_6.0-1
[13] nlme_3.1-153      MASS_7.3-54       dplyr_1.0.7       crayon_1.4.1
[17] vctrs_0.3.8       backports_1.3.0   scales_1.1.1      ellipsis_0.3.2
[21] farver_2.1.0      isoband_0.2.5

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7       pillar_1.6.4     compiler_4.1.1   plyr_1.8.6
 [5] tools_4.1.1      conflicted_1.0.4 lifecycle_1.0.1  tibble_3.1.5
 [9] lattice_0.20-45  pkgconfig_2.0.3  rlang_0.4.12     Matrix_1.3-4
[13] fastmap_1.1.0    stringr_1.4.0    generics_0.1.1   tidyselect_1.1.1
[17] glue_1.4.2       R6_2.5.1         fansi_0.5.0      survival_3.2-13
[21] purrr_0.3.4      magrittr_2.0.1   colorspace_2.0-2 utf8_1.2.2
[25] stringi_1.7.5    munsell_0.5.0
hadley commented 2 years ago

Unfortunately we can't recommend using lib = libFolder as it's hard to predict exactly which library a package will get loaded from. This is likely to be the root cause of your problem.