Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Is there any way to run pylint as python[3] -m pylint not pylint? #1767

Closed
foreverbell opened this issue May 9, 2016 · 2 comments
Closed

Comments

@foreverbell
Copy link

foreverbell commented May 9, 2016

Sorry, here I am just asking a question.

I have both tried

let g:syntastic_python_pylint_exec = 'python -m pylint`

and

let g:syntastic_python_pylint_exec = 'python'
let g:syntastic_python_pylint_args = '-m pylint'

But neither of them works. The first one seems that syntastic doesn't find pylint executable so ignoring pylint checker, the second one keeps telling me that syntastic: error: checker python/pylint: can't parse version string (abnormal termination?), so what is the intended way?

syntastic is upgraded to the newest version, commit d69c878499ab4a07562706e6ba84bcd24660c969.

@lcd047
Copy link
Collaborator

lcd047 commented May 9, 2016

Use *_exe instead of *_exec (yeah, stupid choice of names; too late to change them now). The *_exec thing is supposed to point to an executable, and is used to check that the binary is installed. It's also used to run version checks. On the other hand, *_exe is what is expanded on the command line. When left unset, *_exe is initialised to the value of *_exec. So this should work:

let g:syntastic_python_pylint_exe = 'python -m pylint'

However, if you plan to use this to switch between Python 2 and Python 3 you'll find it fragile, since the version checks will still be for the Python 2 pylint, while you'd run Python 3 pylint for checks (the version checks are used to decide error format). A much better solution would be to use pyenv or viurtualenv to set an environment for the current project, install pylint there, and run Vim from the environment. Then you wouldn't need to tell syntastic which module to load, and this would work for all Python checkers. I really should add this to the FAQ.

@lcd047 lcd047 closed this as completed May 9, 2016
@foreverbell
Copy link
Author

Thank you, I got it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants