You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Activate Python extension if workspace containing .venv or .conda #22814
Open it but do not open any Python files such that the Python extension is not activated
Open a terminal
🐛 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?
Looked at this with Joyce Er (@joyceerhl) . It feels odd that it works sometimes and it doesn't other times from the user perspective. I think we can try .venv and .conda patterns with the workspaceContains activation pattern.
changed the title [-]Virtual environment env vars not contributed for terminal in workspace containing venv if Python extension has not activated[/-]on Feb 1, 2024
Activity
karthiknadig commentedon Jan 30, 2024
Looked at this with Joyce Er (@joyceerhl) . It feels odd that it works sometimes and it doesn't other times from the user perspective. I think we can try
.venvand.condapatterns with theworkspaceContainsactivation pattern.karrtikr commentedon Feb 1, 2024
Looks like ".venv" or ".conda" patterns are missing in the activationEvents:
vscode-python/package.json
Lines 65 to 76 in fb70ef6
[-]Virtual environment env vars not contributed for terminal in workspace containing venv if Python extension has not activated[/-]Activate extension when .venv or .conda found in workspace (#23642)
Activate extension when .venv or .conda found in workspace (#23642)
Activate extension when .venv or .conda found in workspace (microsoft…