question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kernel install failure. Cannot find default main class. [Linux]

See original GitHub issue

I have been attempting to install almond on linux by following the instructions found at: https://almond.sh/docs/quick-start-install

(1) Running the command ./coursier launch --fork almond -- --install results in the error:

Cannot find default main class. Specify one with -M or --main-class.

(2) Running again as ./coursier launch --fork almond -M almond.ScalaKernel -- --install reports:

Installed scala kernel under /home/myuser/.local/share/jupyter/kernels/scala

After (2) I do see a scala kernel option in Jupyter, but clicking it results in a 500 Internal Server Error.

==> Kernel install failure.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
i10416commented, Jul 20, 2021

update @kwalcock

Try ./coursier launch --fork almond:0.11.0 -- --install or ./coursier launch --fork almond:0.11.1 -- --install

I tried reproducing the situation in docker and it seems almond 0.11.2’s bug.

docker run -it ubuntu:18.04 /bin/bash
apt update && apt upgrade
apt install curl
// note: it also failed when using openjdk8-jdk-headless
apt install openjdk11-jdk-headless
curl -Lo coursier https://git.io/coursier-cli
chmod +x coursier
./coursier launch --fork almond  -v -v -- --install
...
Found main classes:
  almond.ScalaKernel (vendor: , title : )
  org.fusesource.jansi.AnsiMain(vendoer: org.fusesource.jansi, title: jansi)
  javassist.ctclass (vendor: , title: Javassist)
  com.sun.jna.Native (vendor: , title: Java Native Access (JNA))
...
Cannot find default main class. Specify one with -M or --main-class.

cs command also failed.

./coursier install cs
cs launch --fork almond  -v -v -- --install
Cannot find default main class. Specify one with -M or --main-class.

Both my local cs and cs inside Docker run successfully when installing almond:0.11.0, 0.11.1 and it shows following main classes.

Found main classes:
  almond.ScalaKernel (vendor: sh.almond, title: scala-kernel)
  org.fusesource.jansi.AnsiMain (vendor: org.fusesource.jansi, title: jansi)
  javassist.CtClass (vendor: , title: Javassist)
  com.sun.jna.Native (vendor: , title: Java Native Access (JNA))

Thit is probably because the latest almond version(0.11.2) is missing (vendor: sh.almond, title: scala-kernel).

0reactions
notmike-5commented, Jul 20, 2021

@ItoYo16u I ran ./coursier launch --fork almond:0.11.1 -- --install --force given your suggestion. It installs a kernel in /home/user/.local/share/jupyter/kernels/scala that jupyter can see.

However, when I go into jupyter to start a new scala notebook I get 500: Internal Server Error and jupyter seems to suggest a permissions error?

[E <t> NotebookApp] Uncaught exception GET /notebooks/Untitled3.ipynb?kernel_name=scala (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled3.ipynb?kernel_name=scala', version='HTTP/1.1', remote_ip='127.0.0.1')

{some stack trace}

PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter/nbconvert/templates/conf.json'

{some stuff about the agent}

[E <t+1> NotebookApp] 500 GET /notebooks/Untitled3.ipynb?kernel_name=scala (127.0.0.1) 97.270000ms referer=http://localhost:8888/tree 
Read more comments on GitHub >

github_iconTop Results From Across the Web

almond-sh/almond - Gitter
Hi, I am trying to install almond for jupyter notebook running on archliunux. I get the error Cannot find default main class. Specify...
Read more >
Options - almond
System-wide kernels get installed under /usr/local/share/jupyter/kernels (Linux and OS X). User-wide ones (default) under ~/.local/share/jupyter/kernels ...
Read more >
Yum update kernel does not boot into new kernel and /boot ...
Hello, We are running RHEL 7.3. We updated using yum update to latest kernel (kernel-3.10.0-862.14.4.el7.x86_64). yum update kernel.
Read more >
Error: kernel headers not found. (But they are in place)
In my case it was actually missing dkms so before you install the addition run sudo apt-get install build-essential linux-headers-`uname -r` dkms.
Read more >
How to compile and install Linux Kernel 5.16.9 from source code
See “Ubuntu Linux Install GNU GCC Compiler and Development Environment” ... compiled kernel got the Kernel Panic error which says can't find
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found