leiden
leiden copied to clipboard
RGL issue
Hi,
I've got a new computer and installed the package from scratch - unfortunately, I can't get it to run despite following the instructions.
This is the error message that I get:
conda environment r-reticulate installed
*** caught segfault ***
address 0x10, cause 'memory not mapped'
Traceback:
1: py_module_import(module, convert = convert)
2: import(module)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch({ import(module) TRUE}, error = clear_error_handler(FALSE))
7: reticulate::py_module_available("umap")
8: install_python_modules()
9: eval(expr, pf)
10: eval(expr, pf)
11: withVisible(eval(expr, pf))
12: evalVis(expr)
13: capture.output(expr, file = file)
14: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
15: suppressPackageStartupMessages(capture.output(expr, file = file))
16: withCallingHandlers(expr, message = function(c) if (inherits(c, classes)) tryInvokeRestart("muffleMessage"))
17: suppressMessages(suppressPackageStartupMessages(capture.output(expr, file = file)))
18: withCallingHandlers(expr, warning = function(w) if (inherits(w, classes)) tryInvokeRestart("muffleWarning"))
19: suppressWarnings(suppressMessages(suppressPackageStartupMessages(capture.output(expr, file = file))))
20: quiet(install_python_modules())
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, classes, parentenv, handlers)
24: tryCatch({ if (reticulate::py_available() || sum("r-reticulate" == reticulate::conda_list()$name) >= 1) { install_python_modules <- function(method = "auto", conda = "auto") { if (!is.null(reticulate::conda_binary())) { reticulate::use_python(reticulate::conda_python()) if (!("r-reticulate" %in% reticulate::conda_list()$name)) { reticulate::conda_create(envname = "r-reticulate", ) if (!reticulate::py_module_available("conda")) reticulate::conda_install(envname = "r-reticulate", packages = "conda") } suppressWarnings(suppressMessages(reticulate::use_condaenv("r-reticulate"))) if (.Platform$OS.type == "windows") { install.packages("devtools", quiet = TRUE) devtools::install_github("rstudio/reticulate", ref = "86ebb56", quiet = TRUE) if (!reticulate::py_module_available("numpy")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "numpy"))) if (!reticulate::py_module_available("pandas")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "pandas"))) if (!reticulate::py_module_available("igraph")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "python-igraph"))) if (!reticulate::py_module_available("mkl")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "mkl", channel = "intel"))) if (!reticulate::py_module_available("umap")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "umap-learn", channel = "conda-forge"))) if (!reticulate::py_module_available("leidenalg")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "leidenalg", channel = "conda-forge"))) install.packages("reticulate", quiet = TRUE) if (!reticulate::py_module_available("leidenalg")) suppressWarnings(suppressMessages(reticulate::conda_install(envname = "r-reticulate", packages = "leidenalg"))) utils::install.packages("reticulate", quiet = TRUE) } else { if (!reticulate::py_module_available("numpy")) suppressWarnings(suppressMessages(reticulate::conda_install("r-reticulate", "numpy"))) if (!reticulate::py_module_available("pandas")) suppressWarnings(suppressMessages(reticulate::conda_install("r-reticulate", "pandas"))) if (!reticulate::py_module_available("igraph")) suppressWarnings(suppressMessages(reticulate::conda_install("r-reticulate", "python-igraph"))) if (!reticulate::py_module_available("umap")) suppressWarnings(suppressMessages(reticulate::conda_install("r-reticulate", "umap-learn", forge = TRUE))) if (!reticulate::py_module_available("leidenalg")) suppressWarnings(suppressMessages(reticulate::conda_install("r-reticulate", "leidenalg", forge = TRUE))) Sys.setenv(RETICULATE_PYTHON = reticulate::conda_python()) } } else { if (!reticulate::py_module_available("numpy")) suppressWarnings(suppressMessages(reticulate::py_install("numpy"))) if (!reticulate::py_module_available("pandas")) suppressWarnings(suppressMessages(reticulate::py_install("pandas"))) if (!reticulate::py_module_available("igraph")) suppressWarnings(suppressMessages(reticulate::py_install("python-igraph", method = method, conda = conda))) if (!reticulate::py_module_available("umap")) suppressWarnings(suppressMessages(reticulate::py_install("umap-learn"))) if (!reticulate::py_module_available("leidenalg")) suppressWarnings(suppressMessages(reticulate::py_install("leidenalg", method = method, conda = conda, forge = TRUE))) Sys.setenv(RETICULATE_PYTHON = reticulate::py_config()$python) } } quiet <- function(expr, all = TRUE) { if (Sys.info()["sysname"] == "Windows") { file <- "NUL" } else { file <- "/dev/null" } if (all) { suppressWarnings(suppressMessages(suppressPackageStartupMessages(capture.output(expr, file = file)))) } else { capture.output(expr, file = file) } } quiet(install_python_modules()) }}, error = function(e) { packageStartupMessage("Unable to install python modules igraph and leidenalg") packageStartupMessage("run in terminal:") packageStartupMessage("conda install -n r-reticulate -c conda-forge vtraag python-igraph pandas umap learn")}, finally = packageStartupMessage("python modules igraph and leidenalg installed"))
25: fun(libname, pkgname)
26: doTryCatch(return(expr), name, parentenv, handler)
27: tryCatchOne(expr, names, parentenv, handlers[[1L]])
28: tryCatchList(expr, classes, parentenv, handlers)
29: tryCatch(fun(libname, pkgname), error = identity)
30: runHook(".onAttach", ns, dirname(nspath), nsname)
31: attachNamespace(ns, pos = pos, deps, exclude, include.only)
32: doTryCatch(return(expr), name, parentenv, handler)
33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
34: tryCatchList(expr, classes, parentenv, handlers)
35: 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) message(paste("Error:", msg), domain = NA) else stop(msg, call. = FALSE, domain = NA)})
36: library(leiden)
Possible actions:
Any idea what could be the issue here? Older versions of the the package worked flawlessly for me.
I was able to isolate the problem - it seems like it doesn't work well with the rgl
package. If I don't load that part of the script the error does not appear. So I'm not sure if this is a Leiden problem or a rgl
problem. I would still appreciate it if you have any input on how to solve this issue!
Thanks for reporting this. It seems to be an issue with installing dependencies in a conda environment. I'm a little confused by this since it has been over a year since significant changes were released on CRAN. It should not be different to when you installed it previously unless it was a long time ago.