4

I want to install ESS. I initialised the package manager with

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)

and try installing ESS with M-x package-install RET ess RET. I get the error

Package `julia-mode-0.3` is unavailable.

I only found this thread, where the same error is a side-effect and has no solution to the problem.

How can I install ESS from MELPA?

Drew
  • 75,699
  • 9
  • 109
  • 225
miguelmorin
  • 1,751
  • 11
  • 33
  • Maybe your package list is out of sync, because both julia-mode and ess are currently available in MELPA. Can you try `M-x package-list-packages`, `r` (refresh packages, which should happen automatically), and then install ESS from the package list? – Tyler Mar 14 '19 at 16:44
  • I tried that and still get the same error. – miguelmorin Mar 15 '19 at 09:59
  • do you see the julia-mode package in the package list? – Tyler Mar 15 '19 at 13:32
  • No, I see `jsx-mode`, `julia-repl`, and `jump-to-line`. I only want to use R, can I disable julia? – miguelmorin Mar 15 '19 at 14:11
  • I don't think you can install ESS from the repository without Julia-mode. You can install it directly from source: https://ess.r-project.org/index.php?Section=download However, julia-mode should be available, at least after you add the melpa repository as @matteol suggested. – Tyler Mar 15 '19 at 15:04
  • @Tyler Yes, I ended up installing from source, and I will add that as an answer. – miguelmorin Mar 15 '19 at 15:58
  • But `julia-mode` is not available in the list, no. It is available with @matteol's answer. – miguelmorin Mar 15 '19 at 17:47
  • Yes, that's what I meant: julia-mode *is* available **after** you follow @matteol answer – Tyler Mar 15 '19 at 17:59

2 Answers2

6

The julia-mode package is in MELPA, but not in MELPA Stable, so you have to add another repository.

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/"))
(package-initialize)

If you prefer to use packages from MELPA Stable when available and use MELPA as a fallback you should set the archive priorities before calling package-initialize

(setq package-archive-priorities
  '(("melpa-stable" . 1)
    ("melpa" . 0)))
matteol
  • 1,868
  • 1
  • 9
  • 11
  • I tried that and still get the same error. – miguelmorin Mar 15 '19 at 10:01
  • 1
    did you make those changes, restart Emacs, and refresh your package list? Have you tried removing ‘melpa-stable’ from your `package-archives`? (And restarting Emacs, and refreshing your package list) – nega Mar 15 '19 at 14:34
  • Yes, it does work with @nega's directions. Now, after I `(require 'ess-site)` and I load a new file, I get `Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)` and `Warning [ess-r-flymake *ess-r-flymake*]: Error in cat("@@warning: @@", e) : argument 2 (type ’list’) cannot be handled by ’cat’` – miguelmorin Mar 15 '19 at 18:11
  • You should create a new question – matteol Mar 15 '19 at 18:15
0

One solution is to install from source. Run these commands in a shell:

git clone https://github.com/emacs-ess/ESS.git /path/to/ESS
cd /path/to/ESS/
make

I needed to comment lines 23-27:

##\__ GNU Emacs __
#EMACS ?= emacs
#SITELISP=\$(PREFIX)/share/emacs/site-lisp
#LISPDIR=\$(SITELISP)/ess
#INFODIR=\$(PREFIX)/share/info
#ETCDIR =\$(PREFIX)/share/emacs/etc/ess

and to uncomment lines 36-42:

##__ GNU Emacs __ for Mac OS X with NeXTstep (Cocoa or GNUstep)
PREFIX=/Applications/Emacs.app/Contents/Resources
EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
SITELISP=\$(PREFIX)/site-lisp
LISPDIR=\$(SITELISP)/ess
INFODIR=/usr/local/info
ETCDIR =\$(PREFIX)/etc/ess

Then run:

sudo make install

And add these lines to ~/.emacs:

(add-to-list 'load-path "/path/to/ESS/lisp/")
(load "ess-site")
miguelmorin
  • 1,751
  • 11
  • 33