How to switch betwen Python 2 and 3 when using Flycheck with flake8 in Emacs?

How to switch betwen Python 2 and 3 when using Flycheck with flake8 in Emacs?

By installing Flycheck for Emacs, I set the parsing to flake8.

Installing flake8with pip install flake8makes Flycheck a Python 2 syntax checker.

However, use pip3 install flake8makes Flycheck a syntax check for Python 3.

How can I switch between modes for Python 2 and 3 in Emacs 24?

+4
source share
1 answer

, anaconda, miniconda virtualenv, pyvenv.el. , , , . python .

. dir-locals.el. emacs , . python- , , .dir-locals.el , .

((nil . ((python-shell-interpreter . "python3"))))

((nil . ((python-shell-interpreter . "python"))))

flycheck . , . this flycheck

+2

All Articles