1

I'm trying to write some R code in Jupyter notebooks (I use python too and would like to be able to use the same app for everything), but I'm having some problems...

I'm on a Mac (Yosemite). I installed Anaconda 3, updated Jupyter, then installed RStudio (which includes R essentials). r-irkernel is installed (I assume also through RStudio), version 0.8.11.

When I try to start an R notebook in Jupyter, it starts a kernel and then immediately it dies. The error given is:

Kernel started: 4275a83e-b2b6-40ef-b161-3a7b2ac57c43
Error: .onLoad failed in loadNamespace() for 'pbdZMQ', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Applications/anaconda3/lib/R/library/pbdZMQ/libs/pbdZMQ.so':
  dlopen(/Applications/anaconda3/lib/R/library/pbdZMQ/libs/pbdZMQ.so, 6): Library not loaded: @rpath/libzmq.5.dylib
  Referenced from: /Applications/anaconda3/lib/R/library/pbdZMQ/libs/pbdZMQ.so
  Reason: image not found
Execution halted

What's the best way forwards, please? What am I missing?

Thanks! :)

hhh
  • 50,788
  • 62
  • 179
  • 282
astro person
  • 381
  • 5
  • 16

3 Answers3

1

Alex Mikhalev's answer partially worked for me. However, it also removed notebook and r-essentials.

Their answer was:

conda remove zeromq
conda install zeromq

But, I also needed to install the following as well:

conda install notebook
conda install r-essentials
Rob
  • 26,989
  • 16
  • 82
  • 98
Lizi Z
  • 11
  • 2
0

Try

conda remove zeromq
conda install zeromq

worked for me.

0

Alas! Other answers have addressed the Anaconda methods so I address the title Jupyter notebooks for R? more generally. Anaconda is nice but always little bit behind. There is also other option to run your Jupyter R notebooks and that is Docker.

Jupyter Docker Stacks

The Jupyter Docker Stacks contains Jupyter R Notebook here available in Github and Docker hub.

You could try it with

$ docker run --rm -it -p 6780:8888 -v "$PWD":/home/jovyan/ jupyter/r-notebook 

as in OS X or

$ docker run --rm -it -p 6780:8888 -v "$PWD":/tmp jupyter/r-notebook 

as in some other distros or as path required to be set up by your os.

You may find the following threads useful

  1. Show volume files in the GUI of Docker Jupyter notebook

  2. Kernel Error in R Jupyter Notebook due to Anaconda?

hhh
  • 50,788
  • 62
  • 179
  • 282