2

我想在 vscode 槽 WSL 中使用由诗歌“创建”的 python 解释器,但正确的 python 版本没有出现在 vscode 中。

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

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

在 vscode 中发现的唯一interperter 是/usr/. 我尝试手动输入 virtualenv 的路径,但没有运气。这是返回的路径which python/home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python

4

1 回答 1

7

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

另外,如果您想获得官方支持,请提出检测诗歌虚拟环境的功能请求。

于 2019-11-20T19:52:59.913 回答