Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing almond to /usr/share/jupyterlab (ie. for all users) doesn't work #729

Closed
qbouvet opened this issue Jan 28, 2021 · 4 comments
Closed

Comments

@qbouvet
Copy link

qbouvet commented Jan 28, 2021

Hi,

I want to install almond to use it in jupyterlab. I would like to install it for all user. Unfortunately, I can't get it to work.

The issue

I want to install almond it to /usr/share/jupyter/kernels, instead of installing to ~/.local/share/jupyter/kernels/scala for a single user. My other kernels (like python3) are indeed located in /usr/share/jupyter/kernels and work fine. So, I install almond with the following command:

$ sudo coursier launch --fork almond:0.10.9 --scala 2.13.1 -- --install --jupyter-path /usr/share/jupyter/kernels/
>>> ... downloads ...
>>> Installed scala kernel under /usr/share/jupyter/kernels/scala

After that, I can start jupyter-lab and the option to create a scala notebook indeed appears. If I create a notebook, the kernel fails to connect (status "Connecting", then "Disconnected" at the bottom left of the web interface). In the console, I have the following error messages:

[I 2021-01-28 16:47:11.133 ServerApp] Kernel started: b1c696f1-0ac7-4096-8733-21d2c6907b21
Error: class almond.ScalaKernel not found
[I 2021-01-28 16:47:14.135 ServerApp] KernelRestarter: restarting kernel (1/5), new random ports
Error: class almond.ScalaKernel not found
[ ... 4 more times]

What is weird is that almond works perfectly if I install it for one user with:

$ coursier launch --fork almond:0.10.9 --scala 2.13.1 -- --install
>>> Installed scala kernel under $HOME/.local/share/jupyter/kernels/scala

Why does it matter ?

The big picture is that I am trying to fix the almond package for arch linux. When packaging, one must install in /usr/local which is the standard location for packages that all users have access to.

System

Kernel: linux-5.4.92-1-lts
Java: Oracle JDK 11 (also tried with Oracle JDK 8)
Coursier: 2.0.7, JVM version from the AUR (although I also tried with 2.0.9 native version from get-coursier)


Could you help me out with this ? Let me know if you need any additional info

Best

@potoo0
Copy link

potoo0 commented Jun 10, 2021

Got some problem.

@potoo0
Copy link

potoo0 commented Jun 13, 2021

Error: class almond.ScalaKernel not found, just because cache path was not specified during installation, so it will use default cache path ~/.cache/coursier/v1, other users will not find the jar in the cache path.

open launcher.jar/coursier/bootstrap/launcher/bootstrap-jar-urls will find:
file:/https/jitpack.io...
...

If we want to install global, must override cache path.

demo:

# create folder for global cache
mkdir /usr/share/coursier/cache
# add to bashrc for all users who want to use kernel
export COURSIER_CACHE=/usr/share/coursier/cache

# install kernel
coursier launch --fork almond:0.10.0 --scala 2.12.11 -- --install --jupyter-path /usr/share/jupyter/kernels/

# change perm for all users who want to use kernel, let's say jupyter group
chgrp -R jupyter /usr/share/coursier
chmod -R g+rwxs /usr/share/coursier

# add kernel read perm for user
chmod -R +r /usr/share/jupyter/kernels/

@tingjhenjiang
Copy link

tingjhenjiang commented Oct 21, 2021

Error: class almond.ScalaKernel not found, just because cache path was not specified during installation, so it will use default cache path ~/.cache/coursier/v1, other users will not find the jar in the cache path.

open launcher.jar/coursier/bootstrap/launcher/bootstrap-jar-urls will find:
file:/https/jitpack.io...
...

If we want to install global, must override cache path.

demo:

# create folder for global cache
mkdir /usr/share/coursier/cache
# add to bashrc for all users who want to use kernel
export COURSIER_CACHE=/usr/share/coursier/cache

# install kernel
coursier launch --fork almond:0.10.0 --scala 2.12.11 -- --install --jupyter-path /usr/share/jupyter/kernels/

# change perm for all users who want to use kernel, let's say jupyter group
chgrp -R jupyter /usr/share/coursier
chmod -R g+rwxs /usr/share/coursier

# add kernel read perm for user
chmod -R +r /usr/share/jupyter/kernels/

I confirmed that this solution works for jupyterhub, conda environments following the jupyterhub installation guide(the difficult way) and the command ./coursier launch --fork almond:0.11.1 --scala 2.13.4 -- --install --id "almond" --jupyter-path "/opt/jupyterhub/share/jupyter/kernels". One must check the correct almond-scala version pairs here.

@qbouvet
Copy link
Author

qbouvet commented Nov 1, 2021

The solution does work. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants