I want pylint to use python3 for linting in Visual Studio code on Mac (which has both python 2.7 standard and python 3.6).
I've tried changing the path to the python interpreter as per How can I debug Python3 code in Visual Studio Code, to no avail. I keep getting python2 errors instead of python3 errors.
See example code for the problem.
Is there a way I can get pylint to recognize python3 errors?
To do so, open the Command Palette (Ctrl+Shift+P) and enter Preferences: Open User Settings. Then set python.defaultInterpreterPath , which is in the Python extension section of User Settings, with the appropriate interpreter.
If VS Code doesn't automatically locate the interpreter you're looking for, refer to Environments - Manually specify an interpreter. You can configure the Python extension through settings. Learn more in the Python Settings reference.
To do so, press CMD + SHIFT + P , type Python, and choose Select Interpreter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With