-
Notifications
You must be signed in to change notification settings - Fork 28
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
'R_user_dir' is not an exported object from 'namespace:tools' #458
Comments
Thanks. It seems that duckdb requires R 4.0.0 in this case. Happy to review a PR that works around, though. The {tools} package is one of R's base packages. tools::R_user_dir
#> function (package, which = c("data", "config", "cache"))
#> {
#> stopifnot(is.character(package), length(package) == 1L)
#> which <- match.arg(which)
#> home <- normalizePath("~")
#> path <- switch(which, data = {
#> if (nzchar(p <- Sys.getenv("R_USER_DATA_DIR"))) p else if (nzchar(p <- Sys.getenv("XDG_DATA_HOME"))) p else if (.Platform$OS.type ==
#> "windows") file.path(Sys.getenv("APPDATA"), "R",
#> "data") else if (Sys.info()["sysname"] == "Darwin") file.path(home,
#> "Library", "Application Support", "org.R-project.R") else file.path(home,
#> ".local", "share")
#> }, config = {
#> if (nzchar(p <- Sys.getenv("R_USER_CONFIG_DIR"))) p else if (nzchar(p <- Sys.getenv("XDG_CONFIG_HOME"))) p else if (.Platform$OS.type ==
#> "windows") file.path(Sys.getenv("APPDATA"), "R",
#> "config") else if (Sys.info()["sysname"] == "Darwin") file.path(home,
#> "Library", "Preferences", "org.R-project.R") else file.path(home,
#> ".config")
#> }, cache = {
#> if (nzchar(p <- Sys.getenv("R_USER_CACHE_DIR"))) p else if (nzchar(p <- Sys.getenv("XDG_CACHE_HOME"))) p else if (.Platform$OS.type ==
#> "windows") file.path(Sys.getenv("LOCALAPPDATA"),
#> "R", "cache") else if (Sys.info()["sysname"] == "Darwin") file.path(home,
#> "Library", "Caches", "org.R-project.R") else file.path(home,
#> ".cache")
#> })
#> file.path(path, "R", package)
#> }
#> <bytecode: 0x11047dda8>
#> <environment: namespace:tools> Created on 2024-10-28 with reprex v2.1.1 |
Looks like you can work around in R < 4.0.0 with something like: dbConnect(
duckdb(config(extension_directory = ..., secret_directory = ...))
) With that, the |
Thanks for this! Working example con <-duckdb::dbConnect(
duckdb( config = list( extension_directory = getwd(), secret_directory = getwd()))
) Can be closed as a workaround has been found. |
Getting the below error trying to use duckdb.
Installation step:
install.packages("duckdb")
which then compiles duckdb
try to run as per below
For this version of R (3.6.3 ), R_user_dir is in backports. Not sure what
namespace::tools
is.Tried running
which is most likely the source calling R_user_dir()
If no workaround exists, any chance a previous version of duckdb would work with R 3.6.3? Current work centred around this version for now.
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_SG.UTF-8 LC_NUMERIC=C LC_TIME=en_SG.UTF-8 LC_COLLATE=en_SG.UTF-8
[5] LC_MONETARY=en_SG.UTF-8 LC_MESSAGES=en_SG.UTF-8 LC_PAPER=en_SG.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_SG.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] duckdb_1.1.0 DBI_1.1.1 pacman_0.5.1
loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3
The text was updated successfully, but these errors were encountered: