Unable to load IRKernel in Jupyter notebook

怎甘沉沦 提交于 2019-12-04 19:59:48

问题


I'm pretty new to the forum, so I'm sorry if this question has already been answered. I looked around, and although I saw that some had similar issues, I couldn't find the solution to my problem on any previous posts. So - here goes...

I'm running Mac OS X 10.11.5, Jupyter notebook version 4.2.1, R version 3.2.2

I installed the R kernel for Jupyter notebook with the following command -

conda install -c r r-irkernel

Now, when I launch Jupyter notebook, I see 'R' appears as one of the options in the drop down menu on the right hand side under 'notebooks.' However, when I try to create an R notebook, the kernel crashes and I get the following error in terminal:

WARNING:root:kernel b42781ab-ebb1-45eb-8a54-d3801106fb94 restarted
Error: .onLoad failed in loadNamespace() for 'pbdZMQ', details:  
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/avislova/anaconda/lib/R/library/pbdZMQ/libs/pbdZMQ.so':
  dlopen(/Users/avislova/anaconda/lib/R/library/pbdZMQ/libs/pbdZMQ.so,     6): Library not loaded: @rpath/libzmq.5.dylib
  Referenced from: /Users/avislova/anaconda/lib/R/library/pbdZMQ/libs/pbdZMQ.so
  Reason: image not found
Execution halted
 [W 16:19:12.382 NotebookApp] KernelRestarter: restart failed
 [W 16:19:12.382 NotebookApp] Kernel b42781ab-ebb1-45eb-8a54-d3801106fb94 died, removing from map.
ERROR:root:kernel b42781ab-ebb1-45eb-8a54-d3801106fb94 restarted failed!
 [W 16:19:12.390 NotebookApp] Kernel deleted before session
 [W 16:19:12.390 NotebookApp] 410 DELETE /api/sessions/2236e334-e33a-483b-87f3-31c461d4903b (::1) 1.32ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=ir

Any idea where I can go from here?

Thank you!


回答1:


I faced similar issue after I updated 'R' on my mac.

Below steps resolved my issue

install.packages(c('pbdZMQ', 'repr', 'devtools'))  
devtools::install_github('IRkernel/IRdisplay')
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()  

For details refer http://johnlaudun.org/20160521-irkernel-difficulties/




回答2:


I frequently find myself reinstalling systems; further to @Jeevan, I always run the following in R at the end of my 'R install process':

install.packages(c("knitr", "ggplot2","rpart.plot","devtools","ggvis","psych","dplyr","tidyr","rvest","magrittr","testthat","roxygen2"),dependencies=TRUE)
#--> set Sweave to knitr

install.packages(c('rzmq','repr','IRkernel','IRdisplay', 'pbdZMQ'),
                 repos = c('http://irkernel.github.io/', getOption('repos')),
                 type = 'source')

IRkernel::installspec()



回答3:


After installing devtools in R:

> install.packages("devtools")

Try installing the following from github:

> library("devtools")
> devtools::install_github("IRkernel/repr")
> devtools::install_github("IRkernel/IRdisplay")
> devtools::install_github("IRkernel/IRkernel")

The last line installed pdbZMQ for me, even though using install.packages("pdbZMQ") reported that none existed for any of the versions of R I tried.

More details and troubleshooting are available on github where I found this solution.



来源:https://stackoverflow.com/questions/38387027/unable-to-load-irkernel-in-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!