Last active
September 20, 2020 13:29
-
-
Save timgreen/e63bfca3742d5a5ee923c02ca394ef40 to your computer and use it in GitHub Desktop.
Scala in Colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://gist.github.com/shadaj/aaac98b690cfeb0cbd891bfe3ce5725d#file-scala-in-colab-template-ipynb | |
SCALA_VERSION=2.12.8 | |
ALMOND_VERSION=0.3.0+16-548dc10f-SNAPSHOT | |
[ -f /usr/local/share/jupyter/kernels/scala/kernel.json ] && exit | |
curl -Lo coursier https://git.io/coursier-cli | |
chmod +x coursier | |
./coursier bootstrap \ | |
-r jitpack -r sonatype:snapshots \ | |
-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-snapshot --embed-files=false | |
rm coursier | |
./almond-snapshot --install --global --force | |
rm almond-snapshot | |
echo "{ | |
\"language\" : \"scala\", | |
\"display_name\" : \"Scala\", | |
\"argv\" : [ | |
\"bash\", | |
\"-c\", | |
\"env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpython3.6m.so:\$LD_PRELOAD java -jar /usr/local/share/jupyter/kernels/scala/launcher.jar --connection-file {connection_file}\" | |
] | |
}" > /usr/local/share/jupyter/kernels/scala/kernel.json | |
echo "Now reload the page to load the notebook in the installed Scala kernel!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment