microsoft / microsoft/vscode-python-environments

VS Code not selecting environment in .venv/ on open with Environments extension installed

Ouverte
#1,468 7 commentaires 2 réactions 1 personne assignée Voir sur GitHub

@eleanorjboyd y travaille déjà.

Depuis le 23/4/2026.

triage-needed
Langage dominant
TypeScript
Étoiles
138
Forks
62
Merge moyen
1 j 4 h
PR mergées (30 j)
35

Description

On Mac OS with the Python & Python Environments extensions installed, VS Code is failing to automatically activate a virtual environment in the .venv/ folder of the project when opened via `code .` in the terminal, or via opening the folder via the UI.

Despite being present in the `Select Python Environment List`.

Image

`.venv` is present in the Python-envs: Workspace Search Paths setting.

Image

To reproduce:

```bash
➜ projects uv init pyenvtest
Initialized project `pyenvtest` at `/Users/nina/projects/pyenvtest`
➜ projects cd pyenvtest
➜ pyenvtest git:(main) ✗ uv venv
Using CPython 3.14.4 interpreter at: /opt/homebrew/opt/python@3.14/bin/python3.14
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
➜ pyenvtest git:(main) ✗ code .
```

Uninstalling the Python Environments extension fixes the issue, and the environment in `.venv/` is automatically selected when VS Code opens.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.