jupyterlab / jupyterlab-desktop

JupyterLab desktop application, based on Electron.
BSD 3-Clause "New" or "Revised" License
3.74k stars 361 forks source link

Can't install R kernel in Jupyter Lab Desktop app #304

Open Dr-Albert-MD opened 3 years ago

Dr-Albert-MD commented 3 years ago

I have always used this procedure inside an R session for the standard jupyter lab R kernal installation: install.packages("devtools") devtools::install_github("IRkernel/IRkernel") IRkernel::installspec()

Anyway, the same procedure seems not to work for Jupyter Lab Desktop app. Any help is appreciated. Thanks

krassowski commented 3 years ago

To install R Kernel in JupyterLab Desktop follow the instructions in https://github.com/jupyterlab/jupyterlab-desktop/blob/master/user-guide.md#customizing-the-bundled-python-environment (i.e. set appropriate permissions to the environment) but then at the point, when %pip install scikit-learn example is suggested please instead run:

%conda install -c conda-forge r-irkernel

Please note that this will install a new copy of R from conda (which may use up a bit of space).

Please leave a comment sharing your experience: did it work for you? Is this what you would expect? Should we include it in the user guide, or do we need a different solution?

Tested on Ubuntu 21.10 with JupyterLab Desktop v3.2.1-2.

gal-lum commented 2 years ago

I've tried this (on Windows 10) and it seems to have worked. However, it seems like I can only pick one kernel per notebook. Is it possible to use the R and python kernels side-by-side?

krassowski commented 2 years ago

Kind of. You can install rpy2 to access R from the Python kernel and then use magics see https://rpy2.github.io/doc/v3.4.x/html/generated_rst/notebooks.html

AlasdairGray commented 2 years ago

It would be great to have details of how to install alternative kernels in the README or at least a link from the README to some instructions.

I've just followed this through on macOS with success.

orboan commented 1 year ago

Hello there, can anyone please give directions on how to install the ijava kernel in JupyterLab desktop? I already have this kernel installed in web based jupyterlab, but I am wondering if the procedure is the same in JupyterLab for dektop.

Thank you!

butuzov commented 1 year ago

Kind of. You can install rpy2 to access R from the Python kernel and then use magics see rpy2.github.io/doc/v3.4.x/html/generated_rst/notebooks.html

let's try

 $ butuzov  ~/Library/jupyterlab-desktop/jlab_server/share/jupyter/kernels
 > tree
.
├── python3
│   ├── kernel.json
│   ├── logo-32x32.png
│   ├── logo-64x64.png
│   └── logo-svg.svg
└── rust
    ├── kernel.js
    ├── kernel.json
    ├── lint-LICENSE
    ├── lint.css
    ├── lint.js
    ├── logo-32x32.png
    ├── logo-64x64.png
    ├── logo-LICENSE.md
    └── version.txt

2 directories, 13 files

now you have new kernel and you can use it!

image