0

Set-up

conda version 24.7.1

Created new environment in anaconda prompt:

conda create --name r_env2 conda conda-forge::r-essentials conda-forge::r-base=4.4.3

Confirmed that r-essentials included caret (6.0_94) and modelmetrics (1.2.2.2).

Started jupyter notebook:

jupyter notebook

First code ran in the notebook (kernel set to R) was:

library(caret)

Problem

After running library(caret), an error window pops up:

The procedure entry point _ZSt21ios_base_library_initv could not be located in the dynamic link library C:\Users\my_user\anaconda3\envs\r_env2\Lib\R\library\ModelMetrics\libs\x64\ModelMetrics.dll

Then, the following error shows in the notebook:

Loading required package: ggplot2

Loading required package: lattice

Error: package or namespace load failed for 'caret' in inDL(x, as.logical(local), as.logical(now), ...): unable to load shared object 'C:/Users/my_user/anaconda3/envs/r_env2/Lib/R/library/ModelMetrics/libs/x64/ModelMetrics.dll': LoadLibrary failure: The specified procedure could not be found.

Traceback:

  1. tryCatch({ . attr(package, "LibPath") <- which.lib.loc . ns <- loadNamespace(package, lib.loc) . env <- attachNamespace(ns, pos = pos, deps, exclude, include.only) . }, error = function(e) { . P <- if (!is.null(cc <- conditionCall(e))) . paste(" in", deparse(cc)[1L]) .
    else "" . msg <- gettextf("package or namespace load failed for %s%s:\n %s", . sQuote(package), P, conditionMessage(e)) .
    if (logical.return && !quietly) . message(paste("Error:", msg), domain = NA) . else stop(msg, call. = FALSE, domain = NA) . })
  2. tryCatchList(expr, classes, parentenv, handlers)
  3. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  4. value[3L]
  5. stop(msg, call. = FALSE, domain = NA)
  6. .handleSimpleError(function (cnd) . { . watcher$capture_plot_and_output() . cnd <- sanitize_call(cnd) . watcher$push(cnd) . switch(on_error, continue = invokeRestart("eval_continue"), . stop = invokeRestart("eval_stop"), error = NULL) . }, "package or namespace load failed for 'caret' in inDL(x, as.logical(local), as.logical(now), ...):\n unable to load shared object 'C:/Users/my_user/anaconda3/envs/r_env2/Lib/R/library/ModelMetrics/libs/x64/ModelMetrics.dll':\n LoadLibrary failure: The specified procedure could not be found.\n", . base::quote(NULL))

I am unsure as to why I am getting this error since this is a fresh environment with the r-essentials and r-base installed using the conda-forge channel, and the modelmetrics packages seems to be the correct version (1.2.2.2).

Any help would be greatly appreciated!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.