pylint在emacs中无法使用

2 投票
1 回答
1224 浏览
提问于 2025-04-18 18:06

我在我的Mac上安装了emacs24(通过homebrew),flycheck(通过MELPA安装)和pylint(通过pip安装),并在我的.emacs文件里有以下代码:

(add-hook 'after-init-hook #'global-flycheck-mode)

但是当我输入Python脚本时,仍然没有语法检查。在emacs的下拉菜单中,语法检查的选项实际上是灰色的,不能点击。

我知道flycheck是正常工作的,因为当我编辑我的.emacs文件时,语法检查是有效的。所以我觉得可能是pylint出了问题。你们觉得我缺少了什么呢?

enter image description here

1 个回答

2

我通过从MELPA安装了一个叫做 exec-path-from-shell 的插件来解决我的问题。然后我在我的 .emacs 文件里加了以下代码。

(require 'exec-path-from-shell) ;; if not using the ELPA package
(exec-path-from-shell-initialize)

撰写回答