A. Vislova
A. Vislova

Reputation: 343

Unable to load IRKernel in Jupyter notebook

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!

Upvotes: 15

Views: 14185

Answers (3)

George Fisher
George Fisher

Reputation: 3364

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()

Upvotes: 3

Jeevan
Jeevan

Reputation: 8772

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/

Upvotes: 10

mightypile
mightypile

Reputation: 8022

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.

Upvotes: 1

Related Questions