Skip to content

Activate Python extension if workspace containing .venv or .conda #22814

@joyceerhl

Description

@joyceerhl
  1. Have a repo that contains a virtual environment
  2. Open it but do not open any Python files such that the Python extension is not activated
  3. Open a terminal
  4. 🐛 the virtual environment is not activated in the terminal and I have to manually activate the environment

Once the Python extension has activated at least once, it contributes those environment variables to the terminal, and VS Code caches those environment variables, so everything works on subsequent runs. Without that context though, the current behavior feels quite unpredictable. It feels like there is a missing activation event for the Python extension in this scenario. Maybe it could also activate on workspaceContains:.venv?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions