microsoft / microsoft/vscode-python-environments

"Create Python Terminal" button doesn't work as expected

未关闭
#1,549 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

Environment data

  • Python Environments extension version: 1.33.2026052901
  • Python extension (ms-python.python) version: 2026.4.0
  • VS Code version (Help → About): 1.120.0
  • OS and version: Windows 11, 25H2
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.7
  • Environment manager in use (venv / conda / pyenv / poetry / pipenv / system / uv / other): venv
  • Shell (bash / zsh / fish / pwsh / cmd / other): pwsh
  • Remote / container scenario (none / WSL / SSH Remote / Dev Container / Codespaces): none
  • Workspace type (single folder / multi-root / mono-repo): single folder / none
  • Is this a regression? If yes, last known working extension version: -

Repro Steps

  1. Ensure that multiple environments are shown in the "Environment managers" list. For me, I have a bunch of venv environments in a folder added to "Global search paths".
  2. Click the "Create Python Terminal" button:
    • With no folder opened
    • With a folder/workspace opened that doesn't have a Project Environment set
    • With a folder/workspace opened that does have a Project Environment set

Expected behavior

In all three cases, the button should open a terminal with the appropriate environment selected (i.e. the one where I clicked the button "Create Python Terminal"

Actual behavior

With no folder opened, the button does nothing.
Otherwise, if no project environment is set, a new terminal is created with no environment activated.
And if a project environment is set, that one is always activated, regardless of which "Create Python Terminal" button was clicked

Logs

With no folder opened: No output at all
With a folder opened:

2026-05-30 10:57:45.745 [debug] Environment c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe is not activatable

With a folder opened that does have a project environment (the project environment is called "ProjectEnvironment", the one I wanted to activate doesn't even appear once in the log):

2026-05-30 10:57:58.703 [info] Python API: Changed environment from Python 3.13 (64-bit) to ProjectEnvironment (3.13.7) for: c:\Users\Lukas\Searches
2026-05-30 10:57:58.703 [info] Internal: Changed environment from Python 3.13 (64-bit) to ProjectEnvironment (3.13.7) for: c:\Users\Lukas\Searches
2026-05-30 10:58:05.614 [debug] Activating terminal: c:\Users\Lukas\venv\ProjectEnvironment\Scripts\python.exe
2026-05-30 10:58:09.626 [debug] Shell execution started: (Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& C:\Users\Lukas\venv\ProjectEnvironment\Scripts\Activate.ps1)
2026-05-30 10:58:09.628 [debug] Checking venv (ms-python.python:venv) for c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.628 [debug] Environment search directories: 3 paths
2026-05-30 10:58:09.629 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-05-30 10:58:09.638 [info] Resolved Python Environment C:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.639 [debug] Environment search directories: 3 paths
2026-05-30 10:58:09.642 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-05-30 10:58:09.648 [info] Resolved Python Environment C:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.650 [debug] Manager venv (ms-python.python:venv) cannot handle c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.650 [debug] Checking PyEnv (ms-python.python:pyenv) for c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.651 [debug] Environment search directories: 3 paths
2026-05-30 10:58:09.651 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-05-30 10:58:09.657 [info] Resolved Python Environment C:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.659 [debug] Checking Pipenv (ms-python.python:pipenv) for c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.661 [debug] Environment search directories: 3 paths
2026-05-30 10:58:09.661 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-05-30 10:58:09.670 [info] Resolved Python Environment C:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.672 [debug] Checking Poetry (ms-python.python:poetry) for c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.674 [debug] Environment search directories: 3 paths
2026-05-30 10:58:09.674 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-05-30 10:58:09.681 [info] Resolved Python Environment C:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.683 [debug] Checking Global (ms-python.python:system) for c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.683 [debug] Using Global (ms-python.python:system) to handle c:\Users\Lukas\AppData\Local\Programs\Python\Python313\python.exe
2026-05-30 10:58:09.922 [info] Terminal is activated: c:\Users\Lukas\venv\ProjectEnvironment\Scripts\python.exe

Additional context

贡献指南

打开贡献指南

从这里开始

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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