【发布时间】:2021-11-02 12:21:39
【问题描述】:
我想在 VScode(Windows) 中为 Python 扩展设置 2 个解释器路径。 我不知道如何也不想使用 .env 文件。我想添加 Python 2.7 和 3.8
VScode 设置.json:
...
"python.languageServer": "Pylance",
"python.defaultInterpreterPath": "C:\\Users\\{myuser}\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe",
"python.showStartPage": false,
...
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Aktuelle Datei",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
}
]
}
我知道有“python.autoComplete.extraPaths”但它不起作用。
【问题讨论】:
-
Python 2.x 已经报废了,再用也没有意义了。 Microsoft Python 扩展还旨在一次支持单个 Python 解释器。
标签: python visual-studio-code vscode-settings vscode-extensions