Skip to content

Vscode doesn't know which Python virtualenv to use if there there are multiple python projects opened #25134

Description

@elieobeid7

I'm using Windows 11 latest update, Vscode latest version, Python version 3.13.3, I'm using pip and vrtualenv, not uv. I don't use uv. I have ruff extension and pylance extensions for Python installed.

To reproduce this bug

  1. Create a python project A, with virtualenv and install some dependencies, and set VScode to use the virtualenv you created by changing the Python interpreter in Vscode.

  2. Create a python project B, with virtualenv and install some different dependencies, and set VScode to use the virtualenv you created by changing the Python interpreter in Vscode.

  3. close all Vscode instances

  4. Open now project A in VSCode, everything works fine

  5. Keep project A open, create a new vsode window, ctrl + shift + n then open project B

Now you'll notice Vscode complaining about some pip dependencies missing from project B, that's simply because vscode is still connected to project A virtualenv, you'll have to switch the interpreter for project B manually by selecting the correct virtualenv.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions