7

Aim

I would like to get PDF Tools installed on my GUI Emacs on MacOSX (version 25.0.50 installed via Homebrew on MacOSX 10.10.2) because the README says it's possible.

Setup

I installed poppler and exported the PKG_CONFIG_PATH variable to my shell as advised by the README.

I then installed PDF Tools via MELPA and it installed a directory in my .emacs.d/elpa directory named ~/.emacs.d/elpa/pdf-tools-20150620.1632

Problem

When I ran the pdf-tools-install command I get the following errors about not being able to find the correct directory:

Need to build the server, do it now ? (y or n) y

pdf-tools--melpa-build-server: No such directory: /Users/m/.emacs.d/elpa/pdf-tools-20150613.414/build

What I've tried

  • I have tried re-installing the package with package-reinstall

  • I have searched for specific answers on EmacsWiki, this site, reddit.

  • 1
    For a period of time melpa hosted a broken package and that's most likely causing this problem. You should update it. – politza Jun 21 '15 at 17:30
  • 1
    Your install directory in MELPA is pdf-tools-20150620.1632, but your error shows another directory, pdf-tools-20150613.414. Something's wrong. Reinstall the packages to reset any older versions that may be causing this. @politza's advice may fix this. – Emacs User Jun 21 '15 at 22:37
10

For me, as of April 13, 2017, a reliable way to install pdf-tools on OS X (Mavericks/Sierra) is to use the following pdf-tools config and directions (in the comments):

;;; Install epdfinfo via 'brew install pdf-tools' and then install the
;;; pdf-tools elisp via the use-package below. To upgrade the epdfinfo
;;; server, just do 'brew upgrade pdf-tools' prior to upgrading to newest
;;; pdf-tools package using Emacs package system. If things get messed
;;; up, just do 'brew uninstall pdf-tools', wipe out the elpa
;;; pdf-tools package and reinstall both as at the start.
(use-package pdf-tools
  :ensure t
  :config
  (custom-set-variables
    '(pdf-tools-handle-upgrades nil)) ; Use brew upgrade pdf-tools instead.
  (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo"))
(pdf-tools-install)

Of course, you don't have to use use-package. You can just require pdf-tools after installing it via Emacs package system and then require it, but you do still have to define the path to epdfinfo as in the code above.

  • 1
    Although this installation method worked for me (+1), just an FYI: I cannot seem to use (pdf-tools-handle-upgrades nil) - I get function void an error. I don't use use-package, so have tried altering the order of things in my .emacs., without success. Not a major issue, as you provide an answer for upgrading too :) Installing from homebrew required brew install homebrew/emacs/pdf-tools. Skimming through the terminal output, I think this is because Mavericks is no longer supported by either Homebrew or Apple. – n1k31t4 Oct 3 '16 at 11:15
  • This snippet failed for me when attempting to download specific dated versions of tablist and pdf-tools. It worked fine with :pin melpa-stable. Thanks! – Dave Aug 13 '18 at 9:39
  • 5
    The Homebrew formula for pdf-tools is no longer part of homebrew-core; it's been migrated to dunn/emacs, so you first need to run brew tap dunn/emacs. – Adam Liter Aug 18 '18 at 2:05
  • 2
    use brew install pdf-tools --HEAD in case you get compiling error with brew install pdf-tools – William Nov 3 '18 at 10:58
4

It worked!

I am not 100% sure on the specifics as to what made it work. As commenters correctly point out, there was an issue with the packages/directories that were installed/compiled but it worked the next time I ran pdf-tools-install

Things I tried/did

  • I started/re-started my emacs --daemon server (ie turned on/off my computer)
  • re-installed the pdf-tools package again (I had tried this, yes)
  • Installed CLISP via homebrew (I have a suspicion this may have helped the script find the right directories because when I was running it via pdf-tools-install it was asking for a directory where autogen.sh was and I was pointing it to the elpa/pdf-tools directory and had tried /usr/local/Cask/... directories where homebrew installed Emacs. Maybe this helped it find the right ones?

Anyways, super happy now as can have my PDF's inside Emacs and as an extra bonus it seems to render eww buffers much better too.

Best of luck to other OSX users getting it up and working. Please post if you pinpoint what helped you get it set up.

Thank you @politza!

enter image description here

  • 2
    You certainly do not need CLIPS for pdf-tools to work. – rekado Oct 13 '15 at 11:22
  • No maybe not, but CLISP helped me and @Dexter Morgan :) – m__ Oct 17 '15 at 4:43
0

[I don't have enough rep to comment]

Installing CLISP and poppler helped me - It didn't work at all before that.

After having these installed (and restarting my machine), I managed to get install successfully (hooray!) - however only with a mixture of terminal and emacs.

According to the instructions You can complete both stages (the compilation and the installation) either via the terminal or within Emacs...

I had to specifically do the compilation in the terminal (to create the pdf-tools-${VERSION}.tar file), but the installation then had to be done in Emacs i.e. using M-x package-install-file RET pdf-tools-${VERSION}.tar RET.

I do not know how the two processes differ, but maybe this helps somebody else out.

0

I have poppler and automake installed using homebrew, however pdf-tools-install failed with: no such program autoreconf. I retried pdf-tools-install from tty/terminal Emacs and everything built correctly. I think some environment settings weren't being picked up in GUI-based Emacs.

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.