Is it possible to change the python version used by syntastic for syntax checking?
As the Issue https://github.com/scrooloose/syntastic/issues/385 indicates I could
In spite of all the answers here, I still find the recommendation from the FAQ to be the best. I have added this to my .vimrc so that I can easily switch between python versions.
function Py2()
let g:syntastic_python_python_exec = '/usr/local/bin/python2.7'
endfunction
function Py3()
let g:syntastic_python_python_exec = '/usr/local/bin/python3.6'
endfunction
call Py3() " default to Py3 because I try to use it when possible
With those functions installed, it's easy to switch python version right within vim with :call Py2() or :call Py3() depending on what I need at the moment. No need to exit vim and activate a different virtualenv as the popular answer would have you do.