vscode not able to show poetry environments when trying to select interpreters
See original GitHub issueType: Bug
I am using poetry to manage my python application. I am letting poetry create the virtualenv in the default location. However when I am trying to select the desired python interpreter from within vscode, its not listing any of my poetry envs. I can see my global python installations and pyenv installations as well but not poetry. I event tried navigating manually but that did not help.
Steps to reproduce
- pyenv local (to set python version to the one mentioned in .python-version file)
- pyenv install (to install the py version)
- poetry env use ~/.pyenv/versions/3.10.8/bin/python
- poetry install
Expected behaviour
- Within vscode the py interpreter from the virtual env created by python should be available to select.
- Once selected all the imports should resolve.
Actual behaviour
- The desired py env is not listed in the select interpretor dropdown list.
Output of poetry env info
Virtualenv
Python: 3.10.8
Implementation: CPython
Path: /Users/dmondal/Library/Caches/pypoetry/virtualenvs/hot-escalation-K4Tshkpo-py3.10
Valid: True
System
Platform: darwin
OS: posix
Python: /Users/dmondal/.pyenv/versions/3.10.8
Out of poetry config --list
cache-dir = "/Users/dmondal/Library/Caches/pypoetry"
experimental.new-installer = true
installer.parallel = true
repositories.artifactory.url = "https://packages.atlassian.com/pypi/pypi/simple/"
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/dmondal/Library/Caches/pypoetry/virtualenvs
Environment Data
- VS Code version: 1.73.1
- Extension version (available under the Extensions sidebar): v2022.18.2
- OS and version: macOS 10.15.7
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.8 (pyenv)
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): Poetry
- Relevant/affected Python packages and their versions: Poetry 1.1.13
I have tried keeping the venv inside project root using virtualenvs.in-project = true
, that works fine. Issue seems to be with envs in default poetry location.
I have tried the solution presented here: https://github.com/microsoft/vscode-python/issues/16232
I tried adding the setting "python.experiments.optInto": ["All"]
but that did not help.
Extension version: 2022.18.2 VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T02:08:38.961Z) OS version: Darwin x64 19.6.0 Modes: Sandboxed: No
Issue Analytics
- State:
- Created 10 months ago
- Comments:5
Feel free to open a new issue with details in that case. New release is expected to go out Dec 7th.
Unfortunately the pre-release version is failing for me due to a different (I think) error.
When is the release version expected to incorporate this fix? Thanks.