3

I am beginner using Emacs 23.4, and I wanted to try a web browser package. From Emacs wiki, I found eww. But when Emacs starts I get from *Warnings*:

File error: Cannot open load file, shr

I get the same thing when I do M-x load-library RET shr.

What I did for installing eww was saving the eww.el file in my ~/.emacs.d/ directory and added this:

(add-to-list 'load-path "~/.emacs.d/")
(require 'eww)

to my ~/.emacs file as well.

I didn't find the shr package to download on internet, and that is why I am lost. Thanks in advance.

  • 1
    eww is built into Emacs 24.4, so you didn't need to download it, unless you have an older Emacs. shr.el is part of Emacs (again, I believe since very recently - at least I'm sure it relies on libxml, which was added not so long ago). You'll also want to read this emacswiki.org/InstallingPackages to figure out how to get Emacs packages with less version conflicts and update mechanism. – wvxvw Dec 14 '14 at 20:25
6

shr and eww can't work in Emacs 23. Regardless of other incompatibilities, they require Emacs to have been compiled with libxml2 support, and that ability came in 24.1

If you want to try eww, you should install Emacs 24.4 or later ("later" currently meaning compiling from the source repository).

Note that eww is built into these versions (24.4+) of Emacs, so in general you shouldn't use downloaded versions of eww with them. Delete any such files from your config, otherwise you might be overriding the in-built version with an incompatible version.

  • I have downloaded Emacs 24 but now I get Cannot open load file, subr-x. I searched but it doesn't seem to be a downloadable package. Should I add this to the question? I am new in SExchange – Nicolas P Dec 15 '14 at 3:05
  • Finally I was able to download subr-x.el, and now I don't have any error message. Also M-x eww seems to work. I still have a problem, though: now it get stuck in Contacting host, but I think that the original issue is solved. Thanks – Nicolas P Dec 15 '14 at 3:24
  • That might be ok, but you're now running Emacs 24 with libraries intended for Emacs 25. That's why eww was looking for a subr-x library. You should probably either (a) remove all of the eww-related libraries that you've downloaded, and simply use the version of eww built into Emacs 24.4; or (b) compile Emacs from source to get the very latest code. (I would strongly recommend starting with (a)). – phils Dec 15 '14 at 4:10
  • What do you mean by "all eww-related libraries that you've downloaded"? I simply downloaded a single file eww.el (and subr-x.el). And even if I remove those files from ~/.emacs.d, I don't see any eww built into Emacs 24 (M-x eww [No match]) – Nicolas P Dec 15 '14 at 4:44
  • Yes, removing eww.el and subr-x.el is what I meant. I wasn't certain if those were the only files you'd downloaded while trying to get this working. Emacs 24.4 includes eww and M-x eww should absolutely work. Are you definitely using 24.4? – phils Dec 15 '14 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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