Reputation: 955
I am currently trying to install ENSIME for emacs 24.3.1 following the instructions at https://github.com/ensime/ensime-emacs under the quick start; I've added
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
to my .emacs file, as instructed. However, when I restart and do M-x package install [RETURN]ensime[RETURN], it returns [No Match] and indeed, I can't find it when I list the packages. However, I can easily find it at http://melpa.milkbox.net/#; what would be causing the discrepancy between what is available through the website and when can be installed from emacs?
Any help is much appreciated; Thank you!
Upvotes: 82
Views: 47035
Reputation: 18901
Emacs v28.2
In my case it seems that a previous attempt at getting started with Emacs left me with a "stale" config file ~/.emacs
which somehow clashed with ~/.emacs.d/init.el
.
So I just deleted ~/.emacs
and things started making sense again.
Make sure you have this in your ~/.emacs.d/init.el
file:
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
Then:
package-refresh-content
⏎package-install
⏎<your-package-name>
⏎Upvotes: 4
Reputation: 375
After doing the usual editing of .emacs to make melpa avalaible and restarting Emacs, I searched the list of packages for the one I wanted.
M-x package-list-packages
C-s <package_name>
Then I clicked on the name of the package and pressed the install button. I am unsure as to why M-x package-install RET <package_name>
failed, but clicking the install button worked for me.
Upvotes: 14
Reputation: 7834
I had to run M-x package-refresh-contents. Once I did that, the files were found.
Here's what my .emacs looks like:
(cond
((>= 24 emacs-major-version)
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
(package-refresh-contents)
)
)
Upvotes: 124
Reputation: 701
In my .emacs file I have
;; packages
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
)
Then, M-x package-list-packages
C-s ensime
and there you go:
ensime 20140718.... available ENhanced Scala Interaction Mode for Emacs
Are you sure your emacs can actually get access to internet?
Upvotes: 49