Path Mac Yosemite上的Emacs flymake

Path Mac Yosemite上的Emacs flymake,path,virtualenv,emacs24,flymake,osx-yosemite,Path,Virtualenv,Emacs24,Flymake,Osx Yosemite,emacs中的Flymake在更新到Yosemite之前一直正常工作。但现在它在抱怨: Flymake: Failed to launch syntax check process 'pychecker' with args (<filename>_flymake.py): Searching for program: no such file or directory, pychecker. Flymake will be switched OFF. 这是/usr/local/b

emacs中的Flymake在更新到Yosemite之前一直正常工作。但现在它在抱怨:

Flymake: Failed to launch syntax check process 'pychecker' with args (<filename>_flymake.py): Searching for program: no such file or directory, pychecker. Flymake will be switched OFF.
这是
/usr/local/bin/pychecker

#! /bin/sh

pyflakes "$1"
pep8 --repeat "$1" --max-line-length=80 --ignore=E123,E133,E226,E501
true
下面是
$PATH

/Users/<user>/Envs/<venv>/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
/Users//Envs//bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
其中,
是我的用户名,
是当前活动的虚拟环境

pychecker
如果从shell运行,则可以正常工作


我通过键入
emacsgui
alias emacsgui='open-a emacs'
)从shell启动emacs,通常是在激活了venv的情况下。我还尝试在没有激活任何venv的情况下打开emacs,但问题仍然存在。问题是什么?

我通过将其添加到我的
.emacs
文件中解决了这个问题:

(defun set-exec-path-from-shell-PATH ()
  (let ((path-from-shell (replace-regexp-in-string
                          "[ \t\n]*$"
                          ""
                          (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))

(when (and window-system (eq system-type 'darwin))
  ;; When started from Emacs.app or similar, ensure $PATH
  ;; is the same the user would see in Terminal.app
  (set-exec-path-from-shell-PATH))

如何从shell RET安装M-x软件包RET exec路径?
(defun set-exec-path-from-shell-PATH ()
  (let ((path-from-shell (replace-regexp-in-string
                          "[ \t\n]*$"
                          ""
                          (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))

(when (and window-system (eq system-type 'darwin))
  ;; When started from Emacs.app or similar, ensure $PATH
  ;; is the same the user would see in Terminal.app
  (set-exec-path-from-shell-PATH))