Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Jupyter笔记本中导入包时出错_Python_R_Jupyter Notebook_Package_Rpy2 - Fatal编程技术网

Python 在Jupyter笔记本中导入包时出错

Python 在Jupyter笔记本中导入包时出错,python,r,jupyter-notebook,package,rpy2,Python,R,Jupyter Notebook,Package,Rpy2,我只是在anaconda之外安装了R和Rstudio,因为它在通过anaconda安装之后并没有启动。现在我无法再在我的jupyter笔记本中导入rpy2,因为这需要花费很长时间,这是在导入rpy2时从终端复制的: [I 11:49:33.918 NotebookApp] Kernel started: 690ca364-26ac-4a95-bce0-15f9ea605749 *** caught segfault *** address 0x2e9e8, cause 'memory not

我只是在anaconda之外安装了R和Rstudio,因为它在通过anaconda安装之后并没有启动。现在我无法再在我的jupyter笔记本中导入rpy2,因为这需要花费很长时间,这是在导入rpy2时从终端复制的:

[I 11:49:33.918 NotebookApp] Kernel started: 690ca364-26ac-4a95-bce0-15f9ea605749

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

Traceback:
 1: initMethodDispatch(where)
 2: fun(libname, pkgname)
 3: doTryCatch(return(expr), name, parentenv, handler)
 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 5: tryCatchList(expr, classes, parentenv, handlers)
 6: tryCatch(fun(libname, pkgname), error = identity)
 7: runHook(".onLoad", env, package.lib, package)
 8: loadNamespace(package, lib.loc)
 9: doTryCatch(return(expr), name, parentenv, handler)
10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
11: tryCatchList(expr, classes, parentenv, handlers)
12: 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)})
13: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,     warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok,     exclude = exclude, include.only = include.only, attach.required = attach.required)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE,     logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly,     mask.ok = mask.ok, exclude = exclude, include.only = include.only,     attach.required = attach.required), error = function(e) e)
18: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
19: .OptRequireMethods()

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection:
 Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: 
Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection: Selection
[I 11:49:33.918 NotebookApp]内核已启动:690ca364-26ac-4a95-bce0-15f9ea605749
***抓住断层***
地址0x2e9e8,导致“内存未映射”
回溯:
1:initMethodDispatch(其中)
2:乐趣(libname,pkgname)
3:doTryCatch(返回(expr)、名称、parentenv、处理程序)
4:tryCatchOne(expr、name、parentenv、handlers[[1L]])
5:tryCatchList(expr、类、parentenv、处理程序)
6:tryCatch(fun(libname,pkgname),error=identity)
7:runHook(“.onLoad”、env、package.lib、package)
8:loadNamespace(包,lib.loc)
9:doTryCatch(返回(expr)、名称、parentenv、处理程序)
10:tryCatchOne(expr、name、parentenv、handlers[[1L]])
11:tryCatchList(expr、类、parentenv、处理程序)

12:tryCatch({attr(包,“LibPath”)安装新R后是否重新安装了rpy2?谢谢你的回答,我尝试了一下,但没有成功。成功的方法是重新安装anaconda并使用conda环境进行“pip安装rpy2”…使用“conda安装rpy2”意味着很多错误,除此之外,我还必须安装java和xquartz。通过基础conda me中的pip安装我对anaconda发行版的几个部分进行了修改,我认为这是造成上述问题的原因。因此,我建议有类似问题的人使用环境。编辑:我仍然必须使用homebrewrpy2的外部版本R和Rstudio,这应该可以很好地与环境配合使用(开发是使用环境完成的).Anaconda似乎涉及许多安装问题,而且在过去,rpy2在其软件包存储库中总是落后于少数版本。您是否在安装了新的R后重新安装了rpy2?谢谢您的回答,我尝试了,但没有成功。成功的是重新安装Anaconda并使用conda环境进行“pip安装rpy2”…Using“conda install rpy2”意味着很多错误,除此之外,我还必须安装java和xquartz。在基本conda中通过pip安装会弄乱我的anaconda发行版的几个部分,我认为这导致了上述问题。因此,我建议有类似问题的人使用环境。编辑:我仍然必须使用外部环境使用homebrewrpy2的R和Rstudio版本应该可以很好地与环境配合使用(开发是使用环境完成的)。Anaconda似乎涉及很多安装问题,而且在过去,rpy2在其软件包存储库中总是落后于少数版本。