I am using emacs on Ubuntu 16.04 and added the configuration for flycheck-mode to include the python3 setup below:
Emacs: How do I set flycheck to Python 3?
Answer: https://stackoverflow.com/a/55000284/719016
(custom-set-variables
'(flycheck-python-flake8-executable "python3")
'(flycheck-python-pycompile-executable "python3")
'(flycheck-python-pylint-executable "python3"))
But my python3 buffer still gives me an invalid syntax [E0001] error in a line like below:
print("# My message for the stderr", file=stderr)
The syntax checkers loaded are python-pylint and python-pycompile (for some reason python-flake8 does not seem to be found.
Any ideas why?
Well, if you took the answer that you quoted literally, your configuration isn't getting loaded. The answer suggests putting the config in
~/.emacs.c/custom.el. That's a typo. The correct path is~/.emacs.d/custom.el. The more correct answer is to put the config in the file pointed to bycustom-file. The most correct answer is to never edit the custom file by hand. Instead use thecustomizefacility.M-x customize-group flycheck.python3for Python3 stuff, even if you only have Python3 on your system. It'll save you headaches later.)custom.el" file.Now, load up a Python3 file you want to use
flycheckwith. If it's not doing what you expect, check things withC-c ! v(akaflycheck-verify-setup.) Confirm individual checkers withC-c ! ?(akaflycheck-describe-checker.) Check the variables you think you're setting withC-h v. Cut-n-paste them fromflycheck's website if you have to.Don't worry about
flake8's config file. It will properly cascade as you expect.And, lastly, as @jenesaisquois suggests: