Package listed in MELPA, but not found in package install

38,300

Solution 1

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?

Solution 2

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)
 )
)

Solution 3

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.

Share:
38,300
user2187656
Author by

user2187656

Updated on March 18, 2020

Comments

  • user2187656
    user2187656 over 4 years

    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!

  • fommil
    fommil almost 8 years
    it's worth pointing out that this is now outdated, please use ensime.org/editors/emacs/install
  • Gauthier
    Gauthier almost 8 years
    That's great, thanks! The question is why package-install did not find it (I had the same problem with clang-format).
  • Rohan Bhatia
    Rohan Bhatia about 6 years
    But getting started on Melpa says Enable installation of packages from MELPA by adding an entry to package-archives after (require 'package) and before the call to package-initialize in your init.el or .emacs file:
  • Scott A
    Scott A about 6 years
    That reversed order likely is what is causing the need for refreshing; ultimately they're the same thing at startup because the package-initialize has nothing to initialize until after add-to-list. I haven't tried this but I will.
  • Ray
    Ray about 6 years
    Same issue when trying to install magit when running M-x package-install RET magit which kept indicating no matches. It showed related packages such as magit-svn, magit-p4, etc. but not simply magit. However, your suggested answer worked in installing it.
  • Kevin Tindall
    Kevin Tindall about 6 years
    @RayVega I'm glad to know my answer is helping others; thanks for letting me know :)
  • jcubic
    jcubic almost 6 years
    calling package-refresh-contents fixed the issue for me.
  • andy256
    andy256 over 4 years
    Isn't ((>= 24 emacs-major-version) the wrong way 'round?
  • Mini Fridge
    Mini Fridge over 3 years
    @Gauthier I found the same behavior. Turns out the package I wanted was already installed that is why package-install could not detect it.
  • hraban
    hraban over 2 years
    Thanks @MiniFridge that was the problem for me. :)