1

I'm trying to install pyflakes with emacs. So far, i've got the flymake.el file from here. I put it inside my .emacs.d folder. Inside my .emacs file, I have this:

(when (load "flymake" t)
  (defun flymake-pyflakes-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-inplace))
           (local-file (file-relative-name
                        temp-file
                           (file-name-directory buffer-file-name))))
  (list "pyflakes" (list local-file))))

  (add-to-list 'flymake-allowed-file-name-masks
               '("\\.py\\'" flymake-pyflakes-init)))

(add-hook 'find-file-hook 'flymake-find-file-hook)

I've also downloaded pyflakes and it's callable from the command line. However, when I open up my emacs with a file, I still get that it cannot find the program 'pyflakes'. Why can't emacs find pyflakes while my command line can? I'm on iOS.

  • You are running Emacs on iOS?! And btw, Flymake is shipped with Emacs, so you've "installed" a file that is already part of Emacs. You are likely even using the builtin version, because `emacs.d` is normally not in the `load-path`. Concerning the problem, inspect the contents of your `exec-path` in your Emacs, and check whether it contains the directory with the pyflakes executable. –  Mar 26 '13 at 23:42
  • 1
    I got it! I added the bin directory where pyflakes was by doing (add-to-list 'exec-path *path-here*) – user1828604 Mar 27 '13 at 04:21

1 Answers1

0

Add /path/to/python/scripts in emacs's exec-path, by either adding the following line to init.el or M-:

(setq exec-path (cons /path/to/python/scripts exec-path))
Bleeding Fingers
  • 6,993
  • 7
  • 46
  • 74