Install R Kernel for JupyterLab
Posted on Dec 25, 2016 in Programming
Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.
** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **
- Install JupyterLab.
wajig install python3 python3-pip python3-setuptools
sudo -H pip3 install jupyter jupyterlab
sudo jupyter serverextension enable --py jupyterlab --sys-prefix
- Install dev libraries required by IRKernel (or its dependent packages).
wajig install libssl-dev libcurl4-openssl-dev
If you are still on Ubuntu 14.04,
you might have to force libssl
to downgrade.
wajig install libssl1.0.0/trusty
- Upgrade R to the latest version.
wajig update && wajig install r-base-core
- Upgrade R packages to the latest version.
Open an R sesseion using
sudo
and run the following statement. It takes a while, so be patient.
update.packages(ask = F, checkBuilt = T)
- Install IRkernel and register it.
# install dependencies packages of IRKernel
install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
# install IRkernel
devtools::install_github('IRkernel/IRkernel')
# register IRkernel
IRkernel::installspec()
If for any reason you cannot install devtools, you can manually download IRkernel and its dependencies and install them.
install.packages('evaluate')
install.packages('uuid')
# assume you have downloaded IRkernel-0.7.1.tar.gz
install.packages('IRkernel-0.7.1.tar.gz')
- Configure JupyterLab. First, run the following command to generate a configuration file for JupyterLab.
jupyter lab --generate-config
Second, edit the configuration file as neede. - ip - browser - working directory
- Make sure that the directory
~/.local/share/jupyter
and its subcontents belogn to you rather thanroot
. If they belong toroot
then change the own to you by running the following command.
sudo chown -R username:usergroup ~/.local/share/jupyter
- Start JupyterLab.
nohup jupyter lab &
Issues
-
Matrices are not displayed correctly. They are shown as vectors instead. However, data frames are displayed correctly.
-
flush.console does not work well.
-
.Last.value retrieves the return value of the last expression in R. It is not working in Jupyter 0.7 or older.
-
IRKernel does not implement magics currently.