Emacs: How do I set flycheck to Python 3?

后端 未结 4 1523
没有蜡笔的小新
没有蜡笔的小新 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:44

    For my case (no pipenv), I got it working by installing the checkers into python3:

    $ pip3 install flake8 pylint mypy
    

    And adding the following to my ~/.emacs.c/custom.el so Flycheck uses python3 for the checkers:

    (custom-set-variables
     '(flycheck-python-flake8-executable "python3")
     '(flycheck-python-pycompile-executable "python3")
     '(flycheck-python-pylint-executable "python3"))
    

    As @uwe-koloska noted, using Ctrl-c ! v to call flycheck-verify-setup is very helpful!

提交回复
热议问题