Unable to load IRKernel in Jupyter notebook

A. Vislova picture A. Vislova · Jul 15, 2016 · Viewed 8.6k times · Source

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!

Answer

Jeevan picture Jeevan · Nov 2, 2016

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/