Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of environments when using venvFolders #24376

Open
karthiknadig opened this issue Nov 1, 2024 · 0 comments
Open

Duplication of environments when using venvFolders #24376

karthiknadig opened this issue Nov 1, 2024 · 0 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@karthiknadig
Copy link
Member

Here's a description why Venv Folders is broken, and the time I wasted learning that fact.

I cleaned up the extra virtual environments left over from my attempts to set things up. I now have only ~/pyenv/3.12. I added pyenv to the list of Venv Folders as pyenv (since the setting says these are folders in my home directory. Now, when I select the interpreter, I see two entries for this same virtual environment:

Image

The behavior of these two entries differs. If I select the first one, with the leading tilde, ~/pyenv/..., then again use Python: Select Interpreter, I see the second one highlighted: the one without the tilde:

Image

Note how the text for the selected interpreter has the tilde, the highlighted one does not.

Now, if I select the second one, the one without the tilde, and again use Python: Select Interpreter, neither of the entries are highlighted:

Image

Note that now the selected path is ./pyenv: that is, relevant to whatever VS Code's working directory happens to be. This can't be a good thing.

Just to test, I tried removing my pyenv entry from Venv Folders and added ~\pyenv instead. Now, my virtual environment does not appear in the Python: Select Interpreter` list.

So, the user has to know to select the entry with the tilde (to get an absolute path), but understand that the UI will mark the one without the tilde. I think this is just a bit confusing.

Originally posted by @paul-rogers in #24364

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 1, 2024
@karthiknadig karthiknadig self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

1 participant