1

I have added these lines to a file ~/.emacs.d/package_init.el

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line

Then I both restarting aquamacs and runing m-x package-initialize, but I fail to find projectile in the listing. Here is a partial screenshot of the result of m-x package-list-packages

enter image description here

I have confirmed that this package exists on MELPA http://stable.melpa.org/#/projectile

What have I done wrong? How can I install this package?

1
  • From your screenshot it looks like this has nothing to do with projectile. None of the Melpa packages show up in your list. Could you edit your question/title to reflect that?
    – Malabarba
    Mar 28, 2015 at 12:34

2 Answers 2

3

What have I done wrong? How can I install this package?

You said you added this configuration to a file called ~/.emacs.d/package_init.el, but Emacs will do nothing to load this file by itself. If you want the configurations to take effect, you need to either put them in ~/.emacs.d/init.el or add a line like the following inside your init.el:

(load (locate-user-emacs-file "package_init.el"))
2
  • You can use locate-user-emacs-file instead of expanding against user-emacs-directory.
    – user227
    Jun 15, 2015 at 21:06
  • @lunaryorn true. Not to mention the snippet I had wss just wrong. :-P
    – Malabarba
    Jun 15, 2015 at 21:09
1

Check *Messages* for any errors that come up when you do M-x package-initialize. You might also try doing a C-h v package-archives to make sure that http://melpa.org/packages/ is really there, and not getting removed somehow.

4
  • The URL is correct: http://melpa.org/packages/ is the official URL of MELPA since some time.
    – user227
    Mar 28, 2015 at 7:58
  • Hmm, I see. I was following this and it works for me: ergoemacs.org/emacs/emacs_package_system.html
    – Brian Z
    Mar 28, 2015 at 8:01
  • 1
    You should follow the official documentation.
    – user227
    Mar 28, 2015 at 8:05
  • I see... looks like it was changed in the last few months. I've edited my answer.
    – Brian Z
    Mar 28, 2015 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.