How to setup Jupyter with dotnet 5 on Arch Linux in 2021

Jupyter “Notebooks” are an interesting way of documenting / teaching code interactively. Jupyter has extended their plattform for other languages (it was originally conceived for Python). See this microsoft anouncement from 2020-06 for dotnet core integration.

This posts describes how to setup JupyterLab on Arch Linux for usage with F#.

Terminology: “JupyterLab” seems to be the successor of “Jupyter Notebooks”. See https://stackoverflow.com/questions/50982686/what-is-the-difference-between-jupyter-notebook-and-jupyterlab for details.

Setup

I use yay as pacman wrapper. It also installs AUR packages.

I also assume dotnet5 is already installed.

  • install Jupyter Lab: yay -S jupyterlab
    • check that jupyter is installed correctly: jupyter kernelspec list should output python3 <some-path>/python3
  • install dotnet-interactive
    • dotnet tool install --global Microsoft.dotnet-interactive
    • dotnet interactive jupyter install
    • start Jupyter Lab: jupyter lab. You should see the newly added .NET plugins (called “kernels” in the Jupyter context) available: launcher dashboard showing dotnet in notebook and console section

Simple test

Kill any previously running sessions with Ctrl-C. And switch to a newly created folder (for example ~/tmp/demo. Now restart jupyter lab.

I’ll skip the “click here, then there” part…

click on dotnet f# display empty notebook enter simple f# assingment highlight execute current block show result

We are all set for jupyter with F#!