我希望 pylint 在 Mac 上的 Visual Studio 代码(同时具有 python 2.7 标准和 python 3.6)中使用 python3 进行 linting。
我尝试按照 How can I debug Python3 code in Visual Studio Code 更改 python 解释器的路径,无济于事。我不断收到 python2 错误而不是 python3 错误。
参见example code对于这个问题。
有没有办法让 pylint 识别 python3 错误?
最佳答案
- 在 Visual Studio Coce(VSC) 中选择一个 xx.py
- 在状态栏中点击 Python 2.7.10,例如 [img1]
- 选择 python 3.x,如 [img2]
- Command+Q 退出 VSC,然后再次打开 VSC
关于python-3.x - 如何让 pylint 在 VS Code 中使用 python 3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47635573/