Type: Bug
Behaviour
Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code
Steps to reproduce:
- Type: print("Hello, World!")
- Select the above line
- Right click selection -> Run Python -> run selection/line in the python terminal
It opens terminal, but does not execute code
The workaround is to launch python from the terminal that just openned.
It looks like old issue came back: https://github.com/microsoft/vscode-python/issues/21393
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2026-08-17 11:41:07.742 [info] Environment discovery is managed by the Python Environments extension (ms-python.vscode-python-envs). Check the "Python Environments" output channel for environment-specific logs.
2026-08-17 11:41:07.952 [info] [test-by-project] Activating project-based testing mode
2026-08-17 11:41:07.952 [info] [test-by-project] Discovering projects for workspace: c:\Users\some_user\My Drive\Projects\Kaggle\Kaggriculture\Kaggriculture
2026-08-17 11:41:07.952 [info] Native locator: Refresh started
2026-08-17 11:41:07.952 [info] [test-by-project] Found 1 total Python projects from API
2026-08-17 11:41:07.952 [info] [test-by-project] Filtered to 1 projects in workspace
2026-08-17 11:41:07.952 [info] [test-by-project] Creating adapter for: Kaggriculture at file:///c%3A/Users/some_user/My%20Drive/Projects/Kaggle/Kaggriculture/Kaggriculture
2026-08-17 11:41:07.962 [info] Native locator: Refresh started
2026-08-17 11:41:07.966 [info] > conda info --json
2026-08-17 11:41:08.077 [info] > pyenv which python
2026-08-17 11:41:08.077 [info] cwd: ~\My Drive\Projects\Kaggle\Kaggriculture\Kaggriculture
2026-08-17 11:41:08.970 [info] [test-by-project] Registered 1 project(s) for c:\Users\some_user\My Drive\Projects\Kaggle\Kaggriculture\Kaggriculture
2026-08-17 11:41:08.971 [info] [test-by-project] Activated 1 project(s) for c:\Users\some_user\My Drive\Projects\Kaggle\Kaggriculture\Kaggriculture
2026-08-17 11:41:08.971 [info] [test-by-project] Subscribed to Python project changes
2026-08-17 11:41:09.718 [info] > "~/My Drive/Projects/Kaggle/Kaggriculture/kenv/Scripts/activate.bat" && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2026.4.0-win32-x64/python_files/printEnvVariables.py
2026-08-17 11:41:09.718 [info] shell: commandPrompt
2026-08-17 11:41:09.723 [info] > "~/My Drive/Projects/Kaggle/Kaggriculture/kenv/Scripts/activate.bat" && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2026.4.0-win32-x64/python_files/printEnvVariables.py
2026-08-17 11:41:09.723 [info] shell: commandPrompt
2026-08-17 11:41:09.919 [info] Starting Pylance language server.
2026-08-17 11:41:10.138 [info] Native locator: Refresh finished in 2185 ms
2026-08-17 11:41:10.139 [info] Active interpreter [c:\Users\some_user\My Drive\Projects\Kaggle\Kaggriculture\Kaggriculture]: c:\Users\some_user\My Drive\Projects\Kaggle\Kaggriculture\kenv\Scripts\python.exe
2026-08-17 11:41:14.404 [info] > ~\AppData\Local\Programs\Python\Python314\python.exe ~\.vscode\extensions\ms-python.python-2026.4.0-win32-x64\python_files\normalizeSelection.py
Extension version: 2026.4.0
VS Code version: Code 1.133.0 (a5b500951314efd502d07465bd138dfbd714a960, 2026-08-11T22:14:08Z)
OS version: Windows_NT x64 10.0.26200
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.14.1
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
- Value of the
python.languageServer setting: Default
User Settings
languageServer: "Pylance"
Installed Extensions
| Extension Name |
Extension Id |
Version |
| copilot-chat |
Git |
0.61.0 |
| debugpy |
ms- |
2026.6.0 |
| js-debug |
ms- |
1.117.0 |
| js-debug-companion |
ms- |
1.1.3 |
| jsts-chat-features |
Typ |
0.0.4 |
| jupyter |
ms- |
2025.9.1 |
| jupyter-keymap |
ms- |
1.1.2 |
| jupyter-renderers |
ms- |
1.3.0 |
| python |
ms- |
2026.4.0 |
| vscode-js-profile-table |
ms- |
1.0.11 |
| vscode-jupyter-cell-tags |
ms- |
0.1.9 |
| vscode-jupyter-slideshow |
ms- |
0.1.6 |
| vscode-pylance |
ms- |
2026.3.1 |
| vscode-python-envs |
ms- |
1.36.0 |
System Info
| Item |
Value |
| CPUs |
Intel(R) Core(TM) Ultra 9 275HX (24 x 3072) |
| GPU Status |
2d_canvas: enabled GPU0: VENDOR= 0x10de, DEVICE=0x2d59 [NVIDIA GeForce RTX 5060 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1047 ACTIVE GPU1: VENDOR= 0x8086, DEVICE=0x7d67 [Intel(R) Graphics], DRIVER_VERSION=32.0.101.8724 GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8875 Machine model name: Machine model version: 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 webgl: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) |
undefined |
| Memory (System) |
31.46GB (11.06GB free) |
| Process Argv |
--crash-reporter-id c5f51013-4a2f-4960-8f4a-5f588a775082 |
| Screen Reader |
no |
| VM |
0% |
A/B Experiments
vsliv368cf:30146710
vswsl492cf:30256860
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
478i5457:31544283
cloudbuttont:31379625
3efgi100_wstrepl:31403338
55ia6109:31457054
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
control_6dc23131:31555649
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
jh5f2457_c:31540921
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
d7b18187:31526828
ahp-both-windows:31556933
session_8:31532895
hjji5903:31534458
f412h606:31551416
7g2b5551:31542111
nes-ex-cf-euporie-03:31542868
enable_editor_pane_layout:31567814
allow-none:31555437
6i51c363:31551401
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31566037
maidictation:31565333
0c1h4866:31566224
session-archive:31558132
be7id924_c:31563078
5b8j3302:31564601
Type: Bug
Behaviour
Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code
Steps to reproduce:
It opens terminal, but does not execute code
The workaround is to launch python from the terminal that just openned.
It looks like old issue came back: https://github.com/microsoft/vscode-python/issues/21393
Diagnostic data
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Extension version: 2026.4.0
VS Code version: Code 1.133.0 (a5b500951314efd502d07465bd138dfbd714a960, 2026-08-11T22:14:08Z)
OS version: Windows_NT x64 10.0.26200
Modes:
python.languageServersetting: DefaultUser Settings
Installed Extensions
System Info
GPU0: VENDOR= 0x10de, DEVICE=0x2d59 [NVIDIA GeForce RTX 5060 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1047 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x7d67 [Intel(R) Graphics], DRIVER_VERSION=32.0.101.8724
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8875
Machine model name:
Machine model version:
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
webgl: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments