Totally lost on incanter install

162 views
Skip to first unread message

Lawrence Bottorff

unread,
Sep 18, 2016, 9:57:41 PM9/18/16
to Incanter
I went to this page this page and grabbed the "Latest build 1.2.x", unpacked it in my ~/bin (where lein is, and also on my machine's PATH), then went to ../script and tried to run ./install. This gave me

./install: 4: cd: can't cd to modules
./install: 6: cd: can't cd to incanter-core
find: ‘src’: No such file or directory
Warning: specified :main without including it in :aot. 
Implicit AOT of :main will be removed in Leiningen 3.0.0. 
If you only need AOT for your uberjar, consider adding :aot :all into your
:uberjar profile instead.
Compiling incanter.main
Created /home/hercynian/bin/incanter/target/incanter-1.2.3-SNAPSHOT.jar
Wrote /home/hercynian/bin/incanter/pom.xml

. . . and lots more error-looking stuff. Then trying ./repl gives me

Error: Could not find or load main class jline.ConsoleRunner

I'm totally lost at this point. However following this in a console's lein repl seemed to work. I'm trying to follow this Clojure tutorial, which is Emacs/cider based. I went into my first project's directory (clojure-noob) and changed the project.clj, guessing which version I needed:

(defproject clojure-noob "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :license {:name "Eclipse Public License"
  :dependencies [[org.clojure/clojure "1.8.0"][incanter "1.9.1"]]
  :main ^:skip-aot clojure-noob.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

then I did

lein deps

. . . which seemed to download(?) a ton of stuff (to where I don't know)

Retrieving incanter/incanter/1.9.1/incanter-1.9.1.pom from clojars
Retrieving incanter/incanter-core/1.9.1/incanter-core-1.9.1.pom from clojars
Retrieving org/clojure/math.combinatorics/0.1.2/math.combinatorics-0.1.2.pom from central
Retrieving net/mikera/vectorz-clj/0.44.1/vectorz-clj-0.44.1.pom from clojars
Retrieving net/mikera/clojure-pom/0.6.0/clojure-pom-0.6.0.pom from clojars
Retrieving net/mikera/mikera-pom/0.6.0/mikera-pom-0.6.0.pom from central
Retrieving org/sonatype/oss/oss-parent/9/oss-parent-9.pom from central
etc.

Then, starting a lein repl, the example worked. I'm guessing this way uses something across the Internet (not my ~/bin/incater download) from Clojars? Again, I'd like to do incanter things inside of my Emacs cider repl . . . and I'd like to understand what I'm doing. . .  if someone could please give me some background, too.


Thanks,
L Bottorff

Sungjin Chun

unread,
Sep 19, 2016, 7:48:29 AM9/19/16
to Incanter
If you know how to use lein, that is, project.clj, then you don't have to install incanter manually. lein will do that for you.

--

---
You received this message because you are subscribed to the Google Groups "Incanter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to incanter+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M A

unread,
Sep 19, 2016, 12:23:25 PM9/19/16
to Incanter, chu...@castlesoft.co.kr
I agree with Chun.  I think the standalone Incanter is sometimes one or more revisions behind the versions that you can pull from clojars by specifying Incanter with Leiningen in project.clj.  Maybe it's not being maintained?  A standalone version might be useful for quick experimentation, but in the end I think that most people would want to use it for specific projects, in which case the Leiningen approach (or Boot, I guess) would be needed.
 

Gary Johnson

unread,
Sep 22, 2016, 10:06:14 AM9/22/16
to Incanter
Hi Lawrence,

Your second approach is the correct one. As some of the other posters have noted, the installer-based version of Incanter doesn't seem to be maintained at this point. Instead, the right way to use it is to include the incanter dependency in your project.clj as you did in your post. When you run "lein deps", this downloads any dependencies listed in your project.clj (as well as their dependencies recursively) to your ~/.m2/repository directory. This is your local JAR cache, which is shared by the maven, lein, and boot build tools. Any dependencies that are already present in your ~/.m2/repository will not be downloaded when running "lein deps".

Essentially, ~/.m2/repository is the Clojure (and Java) equivalent of /usr/lib/python<version> or /usr/lib/perl<version>. It just stores all of the libraries needed by any of your locally installed Clojure programs. The project.clj (or build.boot) in each Clojure program's toplevel directory tells the build tool (usually lein or boot) which of these libraries need to be loaded into the JVM at runtime to support that particular Clojure program. When you run "lein repl", this fires up a JVM, loads in those dependencies from ~/.m2/repository, loads up the Clojure runtime, loads and compiles your program's code,and finally launches a REPL for you to interact with the running process. Any incanter commands you use at that point should work just fine.

If you want to develop and test Clojure code from within Emacs (as a majority of Clojure users do according to the yearly surveys), first fire up Emacs and install CIDER. Then open any file in your Clojure program's directory (usually a source code file under src/) and type C-c M-j (or M-x cider-jack-in) to launch a Clojure REPL with lein (if project.clj is present in the project's toplevel directory) or boot (if build.boot is present). You do not need to run "lein repl" from the command line first (or ever) since CIDER does this for you in the background. Then you'll want to split your screen (C-x 2 or C-x 3) and keep the source code file open in one window while the CIDER REPL is open in the other one. You can use `C-c C-k` to load the current Clojure buffer into the REPL and `C-c C-e` to eval the last s-expression.

Hopefuly, that should give you the tools to get started. Have fun and happy hacking!

  ~Gary

Peter Denno

unread,
Oct 16, 2016, 1:37:14 PM10/16/16
to Incanter

It seems you shouldn't use the installer-based version even as a guide for your own project. It lists 1.5.8.-SNAPSHOT libraries; these won't be found in clojars. What I find today is 1.9.1 versions. I wonder what the problem is with updating the standalone. It looks like some easy fixes would get it running.
Reply all
Reply to author
Forward
0 new messages