Code Monkey home page Code Monkey logo

lein-jupyter's Introduction

lein-jupyter

A Leiningen plugin to integrate with jupyter notebook and JupyterLab.

jupiter Clojars Project Build Status

Features

  • Per project kernel!
  • Parinfer integration! Check out the new parinfer button in the menu bar (jupyter notebook only).
  • Made with love

How to use?

Dependencies

You will need to have leiningen and jupyter notebook installed globally. The development has been done under ubuntu linux with jupyter 4.3.0.

JupyterLab is a separate install which will need to be performed to use the lein jupyter lab command.

Installation

  1. lein-jupyter is a simple leiningen plugin. Hence you can add the [lein-jupyter "0.1.16"] vector in your :plugins list in your project.clj. A simple project.clj might look like

    (defproject my-project "0.1.0-SNAPSHOT"
      :description "FIXME: write description"
      :url "http://example.com/FIXME"
      :license {:name "Eclipse Public License"
                :url "http://www.eclipse.org/legal/epl-v10.html"}
      :dependencies [[org.clojure/clojure "1.9.0"]]
      :main ^:skip-aot my-project.core
      :target-path "target/%s"
      :plugins [[lein-jupyter "0.1.16"]]
      :profiles {:uberjar {:aot :all}})
    
  2. The first time you use lein-jupyter, you will need to install the kernel. lein jupyter install-kernel is the command you need to run to install the kernel. You should run the command once but nothing wrong should happen if you run it more than once.

Customization

All options can be set in the :jupyter-options section of your project.clj's defproject. Bellow is the option list

Option Name Description Example
:jupyter-path the jupyter binary to use /home/ubuntu/anaconda3/bin/jupyter

Using lein-jupyter

The main command line entry is lein jupyter. The first time you use lein-jupyter, you will need to install the jupyter kernel using the lein jupyter install-kernel command. Then, you can use the lein jupyter notebook to run the jupyter notebook, or lein jupyter lab to run JupyterLab.

lein-jupyter's People

Contributors

bherrmann7 avatar gigasquid avatar oylenshpeegul avatar roryk avatar sparkofreason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lein-jupyter's Issues

Not clear how getting started

I am a newbie in clojure and jupyter. So, sorry for the basic questions. I have lein and jupyter installed. When running lein juypiter install-kernel I get the answer: 'jupyter' is not a task. See 'lein help'. How am I supposed to proceed from here on...do I have to set an environement variable or something?

clojure.repl issue

I had to require namespace 'clojure.repl' for commands like (doc println) to work. Example:

(ns myproject.notebook
    (:use [clojure.repl]))

Am I doing something wrong?

Kernel restarting constantly?

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?

Support for returning markdown

For python it's possible to return markdown directly as a result, I would love this to work for the clojure kernel as well.

I'm using lein-jupyter for documentation of a project:
https://bbss.github.io/cljsc2/

Some problems I encountered was manually adding markdown invoked a triggerhappy html sanitizer that removes attributes (such as src on

My assumption is going through the right API such as for python will not invoke the same sanitizer.

I am spending some time to figure out how to achieve this for lein-jupyter. Any pointers would be greatly appreciated @didiercrunch

helper/add-dependencies error HTTPS Required

I am trying the following notebook

https://github.com/alanmarazzi/panthera/blob/master/examples/basic-concepts.ipynb

I get an error on the first cell

(require '[clojupyter.misc.helper :as helper])
(helper/add-dependencies '[panthera "0.1-alpha.20"])

Execution error (TransferFailedException) at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon/fillInputData (AbstractHttpClientWagon.java:852). Failed to transfer file: http://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.pom. Return code is: 501, ReasonPhrase:HTTPS Required.

Indeed, the http link in error message doesn't work while its https counterpart does.

When I add the dependencies to project.clj and open the project with cider then it correctly fetches the libraries.

is there a setting to tell lein-clojupyter to use https?

A new release?

Clojupyter itself is in version 0.2.2 and brings some nice new features.

Could we have a new release of lein-jupyter pointing to the latest release of Clojupyter?

Plugin config for jupyter path

Is it possible to have a configuration for jupyter path. I have a jupyter install from anaconda, but I don't want to export it globally.

lein-jupyter cause Emacs CIDER jack-in failed

When I cider-jack-in in Emacs.
I got this stacktrace output:

error in process sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context, compiling:(/home/stardiviner/Code/Clojure/xunfei-clj/target/5255d819b2d221972cf853eee47613ac47751e42-init.clj:1:8750)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010)
	at clojure.lang.Compiler.analyze(Compiler.java:6773)
	at clojure.lang.Compiler.analyze(Compiler.java:6729)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
	at clojure.lang.Compiler.analyze(Compiler.java:6773)
	at clojure.lang.Compiler.analyze(Compiler.java:6729)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
	at clojure.lang.Compiler.analyze(Compiler.java:6773)
	at clojure.lang.Compiler.access$300(Compiler.java:38)
	at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6368)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
	at clojure.lang.Compiler.analyze(Compiler.java:6773)
	at clojure.lang.Compiler.analyze(Compiler.java:6729)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001)
	at clojure.lang.Compiler.analyze(Compiler.java:6773)
	at clojure.lang.Compiler.eval(Compiler.java:7059)
	at clojure.lang.Compiler.eval(Compiler.java:7052)
	at clojure.lang.Compiler.load(Compiler.java:7514)
	at clojure.lang.Compiler.loadFile(Compiler.java:7452)
	at clojure.main$load_script.invokeStatic(main.clj:278)
	at clojure.main$init_opt.invokeStatic(main.clj:280)
	at clojure.main$init_opt.invoke(main.clj:280)
	at clojure.main$initialize.invokeStatic(main.clj:311)
	at clojure.main$null_opt.invokeStatic(main.clj:345)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
	... 34 more
Subprocess failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.