clojupyter / lein-jupyter

A Leiningen plugin to integrate clojure with jupyter notebook
Eclipse Public License 1.0
100 stars 12 forks source link

Kernel restarting constantly? #11

Open didibus opened 5 years ago

didibus commented 5 years ago

Hey,

It seems that the kernel fails to start, I get:

[I 04:47:43.865 LabApp] KernelRestarter: restarting kernel (1/5), new random ports
WARNING: You have $CLASSPATH set, probably by accident.
It is strongly recommended to unset this before proceeding.

I have python 3.6.5 Jupyter 4.4.0 JupyterLab 0.35.4 Lein 2.9.0

The funny thing is, it seems to call my -main function, and everything inside it works. I can print things, etc.

Right now my guess is, once -main is done executing, it just shutdowns nRepl.

Any idea?

didibus commented 5 years ago

If I follow the clojupyter install info, by cloning and running make; make install. And then start jupyter lab, I don't get this problem.

So it seems unique to lein-jupyter.

realgenekim commented 5 years ago

I had a very similar problem yesterday, while trying to get lein-jupyter to work for the first time. After 3 hours of hunting, and after some sleep, I managed to fix it. (And I'm super excited to finally get it running! :)

It required explicitly including in my project.clj:

[org.clojure/tools.reader "1.3.2"]

The relevant part of the stack trace was here:

```at clojure.tools.reader.edn__init.load(Unknown Source)
at clojure.tools.reader.edn__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)```

I have no idea what the best way to fix this, but I'd love for this to be fixed, so that other people can get it running on their first try. :)

Just FYI, here's my lein dependencies:

  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [org.clojure/data.csv "0.1.4"]
                 [org.clojure/tools.cli "0.3.7"]
                 [org.clojure/tools.reader "1.3.2"]   ; resolve conflict with ghostwheel dependency
                 [clj-http "3.9.1"]
                 ; for type checking
                 [gnl/ghostwheel "0.2.3"]
                 ; generative testing
                 [org.clojure/test.check "0.9.0"]
                 ; graphing/stats
                 [incanter "1.5.7"]
                 [cljsjs/vega "4.4.0-0"]
                 [cljsjs/vega-lite "3.0.0-rc10-0"]
                 [cljsjs/vega-embed "3.24.1-0"]
                 [cljsjs/vega-tooltip "0.13.0-0"]
                 [metasoarous/oz "1.4.0-SNAPSHOT"]
                 [com.cognitect/transit-clj "0.8.313"]
                 [org.clojure/data.json "0.2.6"]
                 [kixi/stats "0.5.0"]]
  :plugins [[com.jakemccrary/lein-test-refresh "LATEST"]
            [lein-jupyter "0.1.16"]]
VictorInacio commented 4 years ago

I had a very similar problem yesterday, while trying to get lein-jupyter to work for the first time. After 3 hours of hunting, and after some sleep, I managed to fix it. (And I'm super excited to finally get it running! :)

It required explicitly including in my project.clj:

[org.clojure/tools.reader "1.3.2"]

The relevant part of the stack trace was here:

```at clojure.tools.reader.edn__init.load(Unknown Source)
at clojure.tools.reader.edn__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)```

I have no idea what the best way to fix this, but I'd love for this to be fixed, so that other people can get it running on their first try. :)

Just FYI, here's my lein dependencies:

  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [org.clojure/data.csv "0.1.4"]
                 [org.clojure/tools.cli "0.3.7"]
                 [org.clojure/tools.reader "1.3.2"]   ; resolve conflict with ghostwheel dependency
                 [clj-http "3.9.1"]
                 ; for type checking
                 [gnl/ghostwheel "0.2.3"]
                 ; generative testing
                 [org.clojure/test.check "0.9.0"]
                 ; graphing/stats
                 [incanter "1.5.7"]
                 [cljsjs/vega "4.4.0-0"]
                 [cljsjs/vega-lite "3.0.0-rc10-0"]
                 [cljsjs/vega-embed "3.24.1-0"]
                 [cljsjs/vega-tooltip "0.13.0-0"]
                 [metasoarous/oz "1.4.0-SNAPSHOT"]
                 [com.cognitect/transit-clj "0.8.313"]
                 [org.clojure/data.json "0.2.6"]
                 [kixi/stats "0.5.0"]]
  :plugins [[com.jakemccrary/lein-test-refresh "LATEST"]
            [lein-jupyter "0.1.16"]]

That worked for me too, tks @realgenekim