vscode找不到python有诗歌和wsl

vscode can't find python with poetry and wsl

我想通过 WSL vscode 中的诗歌使用 python interperter "created",但是 vscode 中没有显示正确的 python 版本=].

我在 WSL 终端中 运行 以下命令:

$ poetry shell
Spawning shell within /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7
$ code .

在 vscode 中发现的唯一干扰者是 /usr/ 中的干扰者。我试过手动输入 virtualenv 的路径但没有运气。这是路径 which python returns: /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python

您可以手动将 "python.pythonPath" 指定为 /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python 或尝试将 "python.venvPath" 设置为 /home/kwint/.cache/pypoetry/virtualenvs,这应该会检测到 Poetry 创建的所有虚拟环境。

此外,如果您想获得官方支持,请feature request to detect Poetry virtual environments