Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
avatar
Cloudera Employee

 

A number of customers want to run CDSW R sessions within the Jupyter Notebook.  This is unsuccessful within CDSW when a customer attempts to perform this and results in the following errors depending on how you execute Jupyter.

 

Execution halted
WARNING:root:kernel 8166ed20-6142-44d1-92b8-9a0ae11777a9 restarted
Error in ok_device(filename, ...) : X11 is not available
Calls: <Anonymous> ... evaluate -> dev.new -> do.call -> <Anonymous> -> ok_device
Execution halted

 

By default the Jupyter R Kernel is not shipped with CDSW 1.5+.  In order to get this to work you will have to install the Jupyter R Kernel manually.  The instructions are below as follows:

 

https://irkernel.github.io/installation/

 

Instructions on installing Jupyter R Kernel from source.

1/2) Installing from source

ZMQ

You'll need zmq development headers to compile pbdZMQ (Click your OS):

R packages

Start R in the same terminal, and proceed as below.

You can install the packages via

install.packages(c('repr', 'IRdisplay', 'IRkernel'), type = 'source')

To update your source installation, repeat above step.

2/2) Making the kernel available to Jupyter

The kernel spec can be installed for the current user with the following line from R:

IRkernel::installspec()

To install system-wide, set user to False in the installspec command:

IRkernel::installspec(user = FALSE)
1,307 Views
Comments
avatar
New Contributor

I'm stuck on this and would really like to use R in jupyterlab as CDSW is putting it plainly a glorified text editor and so would a lot of my colleagues

 

Is there a way to do this without admin rights