Skip to content

Neither 'Start Terminal REPL" or "Run Selection/Line in Python Terminal" work #25419

@yelled1

Description

@yelled1

Type: Bug

Behaviour

Neither 'Start Terminal REPL" nor "Run Selection/Line in Python Terminal" works with venv

Image

Steps to reproduce:

  1. After highlighting code selection
  2. Shift+Enter or Explicitly Right Click 'Run Python'->'Run Selection/Line in Python Terminal' launches REPL. terminal
  3. In addition, when I Ctrl+P and select: 'Python: Start Terminal REPL'
    I get following from the Terminal below:
pyenv shell vtx11
/home/hxxx/.pyenv/versions/vtx11
hxxx@VSS-RM:~/Prj/VertexAi$ pyenv shell vtx11
hxxxn@VSS-RM:~/Prj/VertexAi$ /home/hxxx/.pyenv/versions/vtx11
bash: /home/hxxx/.pyenv/versions/vtx11: Is a directory
hxxx@VSS-RM:~/Prj/VertexAi$ 

(above is from WSL but Windows 11 with Conda does same thing: note 3rd line where directory rather than python.exe is specified)
I tried deleting all other "shift+return" combinations
Tried on conda & pyenv on WSL2 Ubuntu / only conda in Windows
Ubuntu 24.04.3 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)

For some reason when I choose non virtual env python on Ubuntu it works

/bin/python3
hxxx@VSS-RM:~/Prj/VertexAi$ /bin/python3
Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def generate():
...   client = genai.Client(
...       vertexai=True,
...       project="cewlp-ce2bc",
...       location="global",
...   )
... 
>>> 

Note: Run Python File in Terminal works

output of .vscode/settings.json

$ cat .vscode/settings.json
{
    "python-envs.defaultEnvManager": "ms-python.python:pyenv",
    "python-envs.pythonProjects": []
}

Diagnostic data

pyenv shell vtx11
/home/hxxx/.pyenv/versions/vtx11
hxxx@VSS-RM:~/Prj/VertexAi$ pyenv shell vtx11
hxxxn@VSS-RM:~/Prj/VertexAi$ /home/hxxx/.pyenv/versions/vtx11
bash: /home/hxxx/.pyenv/versions/vtx11: Is a directory
hxxx@VSS-RM:~/Prj/VertexAi$ 

Extension version: 2025.12.0
VS Code version: Code 1.103.2 (6f17636121051a53c88d3e605c491d22af2ba755, 2025-08-20T16:45:34.255Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.7
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
copilot Git 1.350.0
copilot-chat Git 0.30.3
debugpy ms- 2025.10.0
js-debug ms- 1.102.0
jupyter ms- 2025.7.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
macro-commander jef 1.6.0
python ms- 2025.12.0
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.7.1
vscode-python-envs ms- 1.2.0
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i5-1345U (12 x 2496)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.64GB (3.14GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs 13th Gen Intel(R) Core(TM) i5-1345U (12 x 0)
Memory (System) 7.58GB (5.39GB free)
VM 0%
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nes-only-control-a100-test:31371767
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
747dc170:31275177
aj953862:31281341
9d2cg352:31346308
nesew2to5:31336538
agentclaude:31374413
4f60g487:31327383
nes-set-on:31340697
onetestforazureexp:31335613
6abeh943:31336334
envsactivate1:31353494
0927b901:31350571
ji9b5146:31348712
custommodel2t:31371781
45650338:31358607
0cj2b977:31352657
justeven_python:31371804
pylancealldocst:31371774
gemagent1:31368469
cloudbuttont:31374192
retryenabled:31370050
ghonly:31363598
3efgi100_wstrepl:31374188

Metadata

Metadata

Assignees

Labels

triage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions