Jupyter R笔记本库(dplyr)导致内核崩溃

时间:2016-05-31 19:49:03

标签: jupyter jupyter-notebook jupyter-irkernel

我正在按照O'Reilly视频教程(http://shop.oreilly.com/product/0636920044260.do)中的说明在MacOS 10.10.5上运行新的Jupyter笔记本。安装miniconda之后,我使用以下命令为R内核创建了一个环境:

conda create -n jupyter_r -c r r-irkernel r-recommended r-essentials anaconda rpy2 -y

在这个环境中,我可以启动jupyter笔记本并创建一个新的R笔记本。

然而,当我尝试执行时:

library(dplyr)

我收到Dead内核错误,内核在我的终端重新启动。

我可以成功执行:

library(ggplot2)
library(lattice)
library(reshape2)

只有库(dplyr)似乎导致崩溃。我也证实了这种情况发生在anaconda和miniconda安装上。

崩溃的输出是:

 *** caught segfault ***
address 0x18, cause 'memory not mapped'

Traceback:
 1: dyn.load(file, DLLpath = DLLpath, ...)
 2: library.dynam(lib, package, package.lib)
 3: loadNamespace(package, c(which.lib.loc, lib.loc))
 4: doTryCatch(return(expr), name, parentenv, handler)
 5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6: tryCatchList(expr, classes, parentenv, handlers)
 7: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
 8: try({    ns <- loadNamespace(package, c(which.lib.loc, lib.loc))    env <- attachNamespace(ns, pos = pos, deps)})
 9: library(dplyr)
10: eval(expr, envir, enclos)
11: eval(expr, envir, enclos)
12: withVisible(eval(expr, envir, enclos))
13: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,     error = eHandler, message = mHandler)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
18: try(f, silent = TRUE)
19: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,     enclos)), warning = wHandler, error = eHandler, message = mHandler))
20: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,     debug = debug, last = i == length(out), use_try = stop_on_error !=         2L, keep_warning = keep_warning, keep_message = keep_message,     output_handler = output_handler)
21: evaluate(request$content$code, envir = .GlobalEnv, output_handler = oh,     stop_on_error = 0L)
22: doTryCatch(return(expr), name, parentenv, handler)
23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
25: doTryCatch(return(expr), name, parentenv, handler)
26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
27: tryCatchList(expr, classes, parentenv, handlers)
28: tryCatch(evaluate(request$content$code, envir = .GlobalEnv, output_handler = oh,     stop_on_error = 0L), interrupt = function(cond) interrupted <<- TRUE,     error = handle_error)
29: executor$execute(msg)
30: handle_shell()
31: kernel$run()
32: IRkernel::main()
aborting ...
[I 15:33:17.931 NotebookApp] KernelRestarter: restarting kernel (1/5)

有关导致此问题的建议吗?我发现了一些对jupyter内核自发崩溃的引用,但似乎并没有特别与dplyr绑定。

谢谢,

亚历

0 个答案:

没有答案