如何将 Python3 设置为 VScode 的默认 Python 解释器?

如何将 Python3 设置为 VScode 的默认 Python 解释器?

我已经成功安装了 VSCode 和 Python 扩展。由于 Ubuntu 附带两个 Python2 版本2.7.12和 Python3 版本3.5.2,因此 VSCode 使用 Python2 作为默认解释器。打开 VSCode 后,我使用命令Ctrl + Shift + P更改首选项,然后输入 Python Interpreter 并从下拉列表中选择 Python3,但出现以下错误。

Failed to set 'pythonPath'. Error: Permission denied writing to file (file:///home/.vscode/settings.json)
Source:Python (Extension)

我如何访问 setting.json 文件并编辑它以将解释器更改为 Python3?

相关内容