Emacs: How do I set flycheck to Python 3?

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

    Flycheck simply calls the pylint executable that should be somewhere in your path. If that executable was installed by pip for python2 then pylint will check python2 syntax if it was installed for pip (sometimes called pip3) for python3 then pylint will check python3 syntax.

    How to proceed depends on a number of things.

    If you are using virtual environments then a good place to start is on this page from flycheck's creator's dotfiles

    This line is also necessary: (add-hook 'flycheck-mode-hook #'flycheck-virtualenv-setup)

    If you are not using virtual environments then you can just make sure that the pylint executable was installed for python3

提交回复
热议问题