I have installed pylint with: pip install pylint and it is in the following path: $HOME/miniconda2/bin and I have add the following to my .bash_profile: export PATH="$HOME/miniconda2/bin:$PATH"

But when selection syntax checker for flycheck I get:

Syntax checker in buffer share_queries.py in python-mode:

  python-pylint (disabled)
    - major mode:         `python-mode' supported
    - may enable:         Automatically disabled!
    - executable:         Not found
    - configuration file: Found at "/Users/larsnielsen/.pylintrc"

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled


Flycheck version: 31snapshot (package: 20161117.144)
Emacs version:    25.1.1
System:           x86_64-apple-darwin16.1.0
Window system:    ns

I am not sure why. Can someone help ?

  • 1
    This library is used by lots of people to set the $PATH on Emacs for OSX: github.com/purcell/exec-path-from-shell . Perhaps that will help you ... I personally set the $PATH on either a buffer-local basis, or when firing up a particular process, which requires some advanced tinkering .... And, there are many instances where I use the absolute path to a particular program by setting the appropriate variable(s) in Emacs; e.g., (setq whatever-program-name-variable "/absolute/path/to/executable"), etc. – lawlist Apr 9 '18 at 17:41

You need to tell python-pylint exactly where to look.

This can be achieved with the following .emacs snippet:

(add-hook 'python-mode-hook
  (lambda ()
     (setq flycheck-python-pylint-executable "<your path to>/pylint")
     (setq flycheck-pylintrc (substitute-in-file-name "$HOME/.pylintrc"))))

adjusting paths accordingly.

If you don`t have a pylint rc file, you can generate it with

pylint --generate-rcfile > $HOME/.pylintrc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.