Skip to content

VSCode doesn't show poetry virtualenvs in select interpreter option #89182

@jaepil-choi

Description

@jaepil-choi
  • VSCode Version: 1.14.1
  • OS Version:
    Windows 10 pro, - 64bit (the latest)
PS C:\Users\Jaepil> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      18363  0

Steps to Reproduce:

  1. Install & set up a poetry environment as explained in the official documentation.
  2. Try to look for available Python interpreters in the command palette. You won't see any.

I've left a detailed explanation on Stackoverflow.

However, the main point is that even though VSCode's official settings reference states that it has default python.poetryPath set for poetry, poetry-created environments' interpreters are not shown in 'Python: Select Interpreter'.

I've also tried adding python.venvPath": "~/.cache/pypoetry/virtualenvs", to my settings.json as suggested in microsoft/vscode-python#8372 (comment) but to no avail. (I have to ask though. It seems that poetry's virtualenvs are located at ~\\AppData\\Local\\pypoetry\\Cache\\virtualenvs, not ~/.cache/pypoetry/virtualenvs. So why did the original issue suggested adding ~/.cache/pypoetry/virtualenvs in the first place?)

I also tried an absolute path, by adding "python.venvPath": "C:\\Users\\Jaepil\\AppData\\Local\\pypoetry\\Cache\\virtualenvs", to the same settings, but it also doesn't work.

At this point, I think it's VSCode's bug that doesn't properly recognize venv's path.

Does this issue occur when all extensions are disabled?: Yes/No

99% Yes. Since Python is also an extension, this won't even run without Python extension enabled. However, any other extensions won't likely affect selecting Python interpreters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    *caused-by-extensionIssue identified to be caused by an extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions