microsoft / microsoft/vscode-python-environments

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

未关闭
#1,468 7 条评论 2 个 reaction 已指派 1 人 在 GitHub 查看

@eleanorjboyd 已经在做这个了。

开始于 2026年4月23日。

triage-needed
主要语言
TypeScript
星标
138
派生
62
平均合并
1 天 4 小时
30 天内合并 PR
35

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。