3

I'm trying to follow the instructions in the README of this repo: https://github.com/jorgenschaefer/elpy . Everything goes smoothly until I get to the point where I am to install the package. After typing elpy and pressing enter I get a [No match] result. Any thoughts?

Here is what happens in detail. I copy and paste:

(require 'package)
(add-to-list 'package-archives
             '("elpy" . "https://jorgenschaefer.github.io/packages/"))

into my scratch buffer. I then type M-x ev-b RET and see no response in the minibuffer. I then type M-x package-refresh-contents RET and see a few quick messages fly by including what seems to be a connection to the github repo and culminates in a 'Package refresh done' message. Finally, when running M-x package-install RET elpy RET I receive a 'No Match' message and a prompt for 'Install package:'.

After all this, upon running C-h v package-archives I get:

package-archives is a variable defined in ‘package.el’. Its value is (("gnu" . "http://elpa.gnu.org/packages/"))

This variable may be risky if used as a file-local variable.

Documentation: An alist of archives from which to fetch. The default value points to the GNU Emacs package repository.

Each element has the form (ID . LOCATION). ID is an archive name, as a string. LOCATION specifies the base location for the archive. If it starts with "http:", it is treated as a HTTP URL; otherwise it should be an absolute directory name. (Other types of URL are currently not supported.)

Only add locations that you trust, since fetching and installing a package can run arbitrary code.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 24.1 of Emacs.

[back]

11
  • It sounds like you haven't properly added the elpy repository from the previous step. What does Emacs tell you after C-h v package-archives?
    – Tyler
    Feb 10, 2017 at 18:04
  • 1
    Please specify precisely/concretely what you've done in order to get to the point of typing "elpy". Just saying that you followed some instructions is not enough (because those instructions may be different/disappeared when this page is read, and because you may have misunderstood those instructions).
    – Stefan
    Feb 10, 2017 at 18:14
  • @Tyler when I run M-x ev-b I see no result in the minibuffer. When I run M-x package-refresh-contents it seems to go smoothly and ends with a "Package refresh done" . The first hint of something wrong is at the M-x package-install stage
    – user14871
    Feb 12, 2017 at 20:50
  • @Stefan I tried to be more specific above
    – user14871
    Feb 12, 2017 at 20:50
  • You haven't answered my question - what is the value of package-archives? You also haven't addressed Stefan's question - please include the exact steps you have taken here, don't just link to another page.
    – Tyler
    Feb 12, 2017 at 21:28

2 Answers 2

0

The add-to-list form you show above should have the effect of adding the elpy repository to your package-archives. So C-h v package-archives should tell you:

package-archives is a variable defined in ‘package.el’. Its value is (("elpy" . "https://jorgenschaefer.github.io/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))

Original value was (("gnu" . "http://elpa.gnu.org/packages/"))

The fact that this isn't happening suggests that add-to-list isn't getting executed properly. I'm not sure why this would be, given the steps you've described.

Another way to accomplish the same thing is to add the code (the require and add-to-list forms you quote) to your config file (~/.emacs or ~/.emacs.d/init.el) and restart emacs. There's no harm in running those two lines every time you start emacs, and that should definitely set your package-archives properly.

At that point, you should be able to proceed with installing elpy: M-x package-refresh-contents followed by M-x package-install RET elpy RET.

It's a bit odd though, as what you've described should work.

0

Sorry for being 2 years late, but unless you already solved your question, the solution is simply to change https://jorgenschaefer.github.io/packages/ to http://jorgenschaefer.github.io/packages/ since the somewhat hacky nature of Emacs doesn't allow it to handle https correctly (at least not on Windows).

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.