Skip to main content
 首页 » 编程设计

python之pylint 在 emacs 中不起作用

2024年10月25日9qq78292959

我的 mac 上有 emacs24(通过 homebrew 安装)、flycheck(通过 MELPA 安装)和 pylint(通过 pip 安装),我有以下代码

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

在我的 .emacs 文件中。但是,当我键入 python 脚本时仍然没有语法检查。从 emacs 下拉菜单中,语法检查实际上是灰色的。

我知道 flycheck 正在运行,因为在我编辑 .emacs 文件时语法检查正在运行,所以我认为这是 pylint 的问题。知道我在这里缺少什么吗?

请您参考如下方法:

我通过安装 exec-path-from-shell 解决了我的问题来自 MELPA 的包裹。我将以下代码添加到我的 .emacs 文件中。

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