Switch Python Version for Vim & Syntastic

mjb4 picture mjb4 · Apr 20, 2014 · Viewed 19.7k times · Source

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 use virtual-env. But is it also possible just with syntastic or vim commands?

Answer

Raphael D. picture Raphael D. · Jul 25, 2018

Easiest solution:

Add this to you .vimrc

 let g:syntastic_python_python_exec = 'python3'
 let g:syntastic_python_checkers = ['python']

This is the straightforward solution to switch to python3.