从脚本更新选定的 python 解释器
Update selected python interpreter from script
我想通过脚本更新 vs 代码中的 selected python 解释器。
我试过:
工作区中的 .vscode/settings.json
允许设置 python.defaultInterpreterPath
但它只能工作一次。即使 UI 中的 select “默认解释器”(例如 python 3.8),关闭 vs code,将设置更改为 3.9,再次打开 vscode,vs code 记住 3.8 .
$config_path/User/workspaceStorage/.../state.vscdb
还包含一个键 ms-python.python
,它为 selected 解释器 autoSelectedWorkspacePythonInterpreter
获取数据 - 但在 [=] 中更改解释器时它甚至不会改变35=](从有意义的设置名称)
vs code 在哪里存储解释器是手动 select 的信息?
任何指针欢迎如何更改使用的 python 解释器(最好从脚本 运行 外部 vs 代码,但如果更容易的话,我也会编写一个 vs 代码扩展 :))
$config_path/User/globalStorage/.../state.vscdb
--> ms-python.python
.
我想通过脚本更新 vs 代码中的 selected python 解释器。
我试过:
-
工作区中的
.vscode/settings.json
允许设置python.defaultInterpreterPath
但它只能工作一次。即使 UI 中的 select “默认解释器”(例如 python 3.8),关闭 vs code,将设置更改为 3.9,再次打开 vscode,vs code 记住 3.8 .$config_path/User/workspaceStorage/.../state.vscdb
还包含一个键ms-python.python
,它为 selected 解释器autoSelectedWorkspacePythonInterpreter
获取数据 - 但在 [=] 中更改解释器时它甚至不会改变35=](从有意义的设置名称)
vs code 在哪里存储解释器是手动 select 的信息?
任何指针欢迎如何更改使用的 python 解释器(最好从脚本 运行 外部 vs 代码,但如果更容易的话,我也会编写一个 vs 代码扩展 :))
$config_path/User/globalStorage/.../state.vscdb
--> ms-python.python
.