简体   繁体   English

vscode用诗歌和wsl找不到python

[英]vscode can't find python with poetry and wsl

I want to use a python interperter "created" by poetry in vscode trough WSL, but the right python version doesn't show up in vscode.我想在 vscode 槽 WSL 中使用由诗歌“创建”的 python 解释器,但是正确的 python 版本没有出现在 vscode 中。

I run the following commmands in a WSL terminal:我在 WSL 终端中运行以下命令:

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

the only interperters found in vscode are the ones in /usr/ .在 vscode 中发现的唯一interperter 是/usr/中的interperter。 I have tried manually inputting the path to the virtualenv but no luck.我尝试手动输入 virtualenv 的路径,但没有运气。 This is the path which python returns: /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python这是which python返回的路径: /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python

You can either manually specify "python.pythonPath" to /home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python or try setting "python.venvPath" to /home/kwint/.cache/pypoetry/virtualenvs and that should detect all virtual environments created by Poetry.您可以手动将"python.pythonPath"指定为/home/kwint/.cache/pypoetry/virtualenvs/metal-hub-python-py3.7/bin/python或尝试将"python.venvPath"设置为/home/kwint/.cache/pypoetry/virtualenvs并且应该检测 Poetry 创建的所有虚拟环境。

Also, please the feature request to detect Poetry virtual environments if you would like to see official support.另外,如果您想获得官方支持,请提出检测诗歌虚拟环境的功能请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM