Emacs Flycheck "Configured syntax checker python-flake8 cannot be used"

The new emacs / python user is here. I am trying to configure flycheck to work (and use flake8 ).

This is the important part in init.el :

 (require 'python-mode) (add-to-list 'auto-mode-alist '("\\.py$" . python-mode)) (add-hook 'python-mode-hook 'flycheck-mode) 

When I open the python file, my model line includes Py FlyC-
I learned from the Flycheck manual that this means that flycheck cannot automatically find the right check.

When I run Mx flycheck-select-checker and select python-flake8 , it returns:

 Configured syntax checker python-flake8 cannot be used 

I am using OSX 10.9 with homebrew and these versions are:

 $ emacs --version GNU Emacs 24.3.50.1 $ flake8 --version 2.1.0 (pep8: 1.4.6, pyflakes: 0.7.3, mccabe: 0.2.1) CPython 2.7.5 on Darwin $ which flake8 /usr/local/bin/flake8 $ python --version Python 2.7.5 $ which python /usr/local/bin/python 

As for emacs packages, they are installed from melpa and marmalade

python-mode version: 6.0.10
flycheck version: 0.15snapshot (package: 20131105.1502)

Any clues on how to do this?

+6
source share
1 answer

Make M-: (executable-find "flake8") . If it says nil , add /usr/local/bin to your exec-path .

In OS X, GUI applications do not inherit variables from the shell configuration and therefore have different $PATH . Therefore, the ability to run flake8 in a terminal does not mean that Emacs can also find it.

You can also see the exec-path-from-shell package.

+12
source

Source: https://habr.com/ru/post/957469/


All Articles