Skip to content

Running Python file in Conda environment opens flash window with transient output, unlike base environment #782

@Kendr1ckFu

Description

@Kendr1ckFu

Type: Bug

Behaviour

When running a Python file in a Conda environment created via conda create, the execution command is split into two steps:

  1. > activate.bat py312
  2. > conda run --live-stream --name py312 python {python_file_path}

This causes the output to appear in what seems like a separate, transient terminal window (or subprocess) that flashes and closes quickly. As a result:

  • Standard output flashes and disappears.
  • Cannot scroll through output using the mouse wheel.
  • Poor user experience compared to running in the base/global environment.

In contrast, when using the global (base) Python environment instead of conda, the command is simply:

> python.exe {python_file_path}

and the output is displayed properly within the integrated VS Code terminal, allowing full interaction (scrolling, viewing, etc.).

Expected behavior: Output should be shown directly in the VS Code integrated terminal for all environments, without spawning transient external windows.

Steps to reproduce:

  1. Create a new conda environment: conda create -n py312 python=3.12
  2. Activate the environment in VS Code (via Command Palette → "Python: Select Interpreter" and choose the interpreter from py312)
  3. Open a simple Python file (e.g., one with print("Hello"))
  4. Run the file using the "Run Python File" button (▶️) in the top-right corner or via right-click → "Run Python File in Terminal"
  5. Observe that the output flashes briefly and cannot be scrolled, while the terminal shows the two-step activation and conda run command
  6. Switch to the base environment's interpreter and repeat step 4 — observe that output now persists and is scrollable

--

Extension version: 2025.10.0
VS Code version: Code 1.102.3 (488a1f239235055e34e673291fb8d8c810886f81, 2025-07-29T03:00:23.339Z)
OS version: Windows_NT x64 10.0.19045
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i5-13400 (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.62GB (6.08GB free)
Process Argv --crash-reporter-id 9a7680a8-1840-427c-9b3f-816755953f06
Screen Reader no
VM 50%
A/B Experiments
vsliv368:30146709
binariesv615:30325510
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
convertlamdaf:31368658
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31350858
replacestringexc:31350595
nes-set-on:31351930
6abeh943:31336334
envsactivate1:31353494
yijiwantestdri0626-t:31336930
0927b901:31350571
ji9b5146:31348712
45650338:31358607
0cj2b977:31352657
retrydisabled:31368125

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions