| Hosted by CoCalc | Download

Install the Almond Scala Jupyter kernel in a CoCalc project

Author: Samuel Lelièvre

Date: 2019-01-15

License: CC0

Note: a new attempt almost a year later is described at:

History of the problem

After initial interest for a Scala Juptyer kernel in CoCalc, an issue was opened:

The IScala Juptyer kernel was installed and available in CoCalc for a while.

With the upgrade of the CoCalc project image to Ubuntu 18.04, IScala failed to install. Its development also seems to have stopped in 2014. Since then, there is no longer a Scala Jupyter kernel available on CoCalc, unless one switches to the old image. See

Almond is a currently maintained Scala Jupyter kernel.

Installing Almond in a CoCalc project

We follow the quick start installation guide:

The guide suggests setting the SCALA_VERSION and ALMOND_VERSION environment variables.

We check the Scala version installed in CoCalc:

~$ scala Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/home/user/tmp/ -Xms64m Welcome to Scala 2.11.12 (OpenJDK 64-Bit Server VM, Java 10.0.2). Type in expressions for evaluation. Or try :help. scala>

Leave using [removed]ctrl+[removed]D (or type :quit).

Seems the available version of Scala is 2.11.12.

The Almond website has a "versions" section:

which says all versions >= 0.13.x will install for SCALA 2.11.12.

So we check the latest release

and we set:

~$ SCALA_VERSION=2.11.12 ALMOND_VERSION=0.2.1

For the next step, we need Coursier (not available system-wide on CoCalc).

The new Coursier website is work in progress, but there is a "former readme" with instructions:

Installing Coursier works fine following the "Command line" section of the "former readme":

~$ curl -L -o coursier https://git.io/vgvpD && chmod +x coursier && ./coursier --help

Then we can get Almond:

$ ./coursier bootstrap \ -r jitpack \ -i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \ sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \ --sources --default=true \ -o almond

and install it:

~$ ./almond --install

Trying it out

There is a demo Jupyter Notebook at:

We download it

~$ curl -O https://raw.githubusercontent.com/almond-sh/almond/master/examples/plotly-scala.ipynb

Sadly, no output appears.

References