Emacs: How do I set flycheck to Python 3?

后端 未结 4 1524
没有蜡笔的小新
没有蜡笔的小新 2021-02-12 19:01

I\'ve installed flycheck for Emacs Python on Ubuntu 15.04.

However, when using the tool it reports false positives like print(item, end=\' \') is wrong synt

4条回答
  •  难免孤独
    2021-02-12 19:50

    As @Jules mentioned:

    Flycheck simply calls the pylint executable that should be somewhere in your path.

    So it becomes critical that the correct flake8 version is accessible within emacs. Since you are using pipenv, you should be sure to first install flake8 within your project's environment, and then ensure that your environment is activated before launching emacs.

    From within your project root directory:

    pipenv install flake8
    pipenv shell
    

    You can then launch emacs from the commandline, and flycheck will connect with the correct version of flake8 for your project.

提交回复
热议问题