Help with Incanter and Emacs

374 views
Skip to first unread message

Akhil Wali

unread,
Aug 13, 2013, 1:59:42 PM8/13/13
to clo...@googlegroups.com
Hi All, 

A really noob question.

Why do I get "FileNotFoundException Could not locate incanter__init.class or  incanter.clj on classpath:   clojure.lang.RT.load (RT.java:443)" when i load a file that uses incanter in emacs?
Here's the file...

(ns default.core
  (:require incanter core charts stats datasets))

(defn plot []
  (view (scatter-plot :Sepal.Length :Sepal.Width
                      :group-by :Species
                      :data (get-dataset :iris))))

(plot)

This works in lein repl just fine.
I'm using Emacs 24 and nrepl.el 0.1.8.

This issue was posted on Github way long back. Seems to be solved, but by simply upgrading emacs. Doesn't really work in my case.
Any advise?


Tim Visher

unread,
Aug 13, 2013, 2:05:58 PM8/13/13
to Clojure
Couple things.

1. I'm assuming you've declared the proper dependencies in your
`project.clj` file since this works from `lein repl`, however it's
worth checking.

2. How are you connecting to your project? Simply loading the
namespace won't work if you haven't properly jack in. There's a number
of options here but the simplest is probably to use `M-x
nrepl-jack-in` (usually bound to `C-c M-j`) from this file. It should
Just Work™.

If that doesn't work, I'd probably post some more details about the
project somewhere. At least the `project.clj` and the whole ns would
be helpful in a gist of some sort.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

Akhil Wali

unread,
Aug 13, 2013, 2:11:29 PM8/13/13
to clo...@googlegroups.com
Well 
Here's my project.clj.

(defproject someproj "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [incanter "1.5.2"]])

Here's my .lein/profiles.clj as well.

{:user {:plugins [[lein-ritz "0.7.0"]
                  [compojure-app/lein-template "0.2.7"]]
        :dependencies [[ritz/ritz-nrepl-middleware "0.7.0"]]
        :repl-options {:nrepl-middleware
                       [ritz.nrepl.middleware.javadoc/wrap-javadoc
                        ritz.nrepl.middleware.simple-complete/wrap-simple-complete]}}}

Tim Visher

unread,
Aug 13, 2013, 2:24:24 PM8/13/13
to Clojure
And you're connecting to the project how?
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Akhil Wali

unread,
Aug 13, 2013, 2:27:46 PM8/13/13
to clo...@googlegroups.com
Yes, by nrepl-jack-in.

Akhil Wali

unread,
Aug 13, 2013, 2:40:58 PM8/13/13
to clo...@googlegroups.com
Well this is embarrassing. 

I was having a wrong use syntax >.<.
Changed the import line to this and it works.

(ns default.core
  (:use [incanter core charts stats datasets]))

Thanks for the help though!!

Tim Visher

unread,
Aug 13, 2013, 3:09:20 PM8/13/13
to Clojure
LOL. I just realized I'd been missing that all along.

It seems like the community is more and more leaning to something like
this, just FYI.

(ns default.core
(:require (incanter [core :refer :all]
[charts :refer :all]
[stats :refer :all]
[datasets :refer :all])))

`:use` has been discussed in the interest of deprecating it many times.

I did not test the above declaration.

Akhil Wali

unread,
Aug 13, 2013, 3:17:53 PM8/13/13
to clo...@googlegroups.com

Ah I see. :use is deprecated since 1.4. And your ns declaration works fine! Kudos!

You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/aG2ejaNBUqs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Robert Berger

unread,
Jan 12, 2015, 7:48:44 PM1/12/15
to clo...@googlegroups.com, tim.v...@gmail.com
Wish this was in the Incanter docs and in the Readme

Sam Raker

unread,
Jan 13, 2015, 6:17:46 PM1/13/15
to clo...@googlegroups.com, tim.v...@gmail.com
For something that's been "deprecated" for a while now, `use` sure still shows up in A LOT of docs/tutorials/books/etc.
Reply all
Reply to author
Forward
0 new messages