Fork me on GitHub

I'm trying out clojupyter with @jlmr's awesome parinfer plugin above, does anyone know how to start a kernel from within an existing deps.edn project?


The guides and examples seem to be oriented towards standalone notebooks with interactively added dependencies, but I'm thinking more of using it as a persistent graphical REPL / interface to my library, if that makes sense


@qythium, I don’t know if clojupyter supports this. Personally I use the IClojure kernel: It has a special form /cp that you can use to add dependencies to the classpath in the form of the :deps key from deps.edn. You could use this to first read in your deps.edn file and then do something like /cp (:deps your-parsed-edn-file).


But maybe someone with more experience with clojupyter knows of another way?


Thanks for the pointer - I'm still unclear what the practical difference is between IClojure and Clojupyter kernels, just went with the latter because it's nREPL-based and supports hiccup HTML display out of the box, but I'm not strongly attached to either one.


@jlmr I installed IClojure and tried out /cp (:deps (read-string (slurp "deps.edn"))) as suggested, but that didn't work - looks like it's a macro which expects a map literal instead of an expression to eval


Also make sure you use clojure.edn/read-string as opposed to clojure.core/read-string?


besides, I don't think that would add the namespaces in my local library's src/ folder to the classpath?


Ideally I'd like to be able to "jack in" to my project and start a REPL server from the command line, then connect to it from Jupyter and have access to the same interactive state, just like a REPL with rich display capabilities - not sure if such a workflow exists?


@qythium strange that this (`/cp (:deps (read-string (slurp "deps.edn")))`) doesn’t work. The documentation specifically states that /cp (form that evaluates to a deps.edn map) this should work. Maybe drop the :deps key and put in the whole map?


I’m afraid I can’t help you further, I usually use notebooks for seperate projects to quickly visualize something. However, there is also this: It think it works with leiningen, but you could take a look at how it works.


yeah, looks like /cp {org.clojure/core.match {:mvn/version "0.3.0"}} works, but /cp (hash-map 'org.clojure/core.match {:mvn/version "0.3.0"}) throws an exception in the terminal


might look into it further and open an issue on the IClojure repo


I'll check out lein-jupyter and see if it can be ported over to tools.deps projects, thanks! Just checking to see if anyone else has done this before 🙂