Skip to content

[Python Environments] Activation of any other environments fail when opening file without workspace #1522

@donaldnguyen99

Description

@donaldnguyen99

Type: Bug

Description

After opening a Python file using the file explorer, right-clicking and selecting "Open with Code", I cannot change the environment that has been selected by default. Also, an isort error message appears on the launch of vscode, which may be related, as the selected environment does not have that python package installed.

Steps to Reproduce

  1. Open the file using "Open from file" or from file explorer, right-clicking on the file, selecting "Open in Code"
  2. Click on the environment in the bottom right.
  3. Select a different environment on the pop-up

Expected Behavior

Python changes to any other environment besides the first "Python 3.13.11 (3.13.11.final.0) - C:\msys64\mingw64\bin\python.exe"

Actual Behavior

The Python environment is stuck in the same environment.

Environment Information
Extension Version: 1.30.0
Python Extension Version: 2026.4.0

Registered Environment Managers (6):
  - ms-python.python:system (Global)
  - ms-python.python:venv (venv)
  - ms-python.python:pyenv (PyEnv)
  - ms-python.python:pipenv (Pipenv)
  - ms-python.python:poetry (Poetry)
  - ms-python.python:conda (Conda)

Total Available Environments: 22
Environment Details:
  1. Python 3.13.11 (3.13.11.final.0) - C:\msys64\mingw64\bin\python.exe
  2. Python 3.13.11 (3.13.11.final.0) - C:\msys64\mingw64\bin\python3.13.exe
  3. Python 3.13.11 (3.13.11.final.0) - C:\msys64\mingw64\bin\python3.exe
  4. Python 3.13.11 (3.13.11.final.0) - C:\msys64\ucrt64\bin\python.exe
  5. Python 3.13.11 (3.13.11.final.0) - C:\msys64\ucrt64\bin\python3.13.exe
  6. Python 3.13.11 (3.13.11.final.0) - C:\msys64\ucrt64\bin\python3.exe
  7. pygame (3.12.8) (3.12.8) - C:\ProgramData\anaconda3\envs\pygame
  8. pygame (3.12.8) (3.12.8) - C:\ProgramData\Anaconda3\envs\pygame
  9. py312 (3.12.0) (3.12.0) - C:\ProgramData\anaconda3\envs\py312
  10. py312 (3.12.0) (3.12.0) - C:\ProgramData\Anaconda3\envs\py312
  ... and 12 more environments

Python Projects (0):

Extension Settings:
  Default Environment Manager: ms-python.python:venv
  Default Package Manager: ms-python.python:pip
Auto-activation is "command". Activation based on first 'py-env.terminal.autoActivationType' setting which is 'command' and 'python.terminal.activateEnvironment' if the first is undefined which is 'true'.

Extension version: 1.30.0
VS Code version: Code 1.119.0 (8b640eef5a6c6089c029249d48efa5c99adf7d51, 2026-05-05T11:23:50-07:00)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs AMD Ryzen 9 5900X 12-Core Processor (24 x 3700)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2206 [NVIDIA GeForce RTX 3080], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.9649 ACTIVE
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8328
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
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.91GB (15.63GB free)
Process Argv C:\Users\DonaldNguyen\Documents\Homework\SFSU\2020-Spring\PHYS-740-Computational-Physics\Assignment-4\Assignment-4.py --crash-reporter-id 58822330-6a85-409c-b00d-ed84d41da2ac
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
4f60g487:31327383
6abeh943:31336334
envsactivate1:31505457
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ddidt:31399633
ec5jj548:31422691
nes-callisto-dd-16:31508045
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31505030
4je02754:31466945
c3h7c220:31478652
38bie571_auto:31426784
cp_cls_c_1081:31454833
conptydll_true:31498968
ia-use-proxy-models-svc:31452481
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
control_6dc23131:31513188
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31507493
7e187181:31503455
i2gc6536:31499202
52612955:31513034
ghj88844:31499326
h08i8180:31475369
23c7c724:31491644
ddid_t:31478206
getcmakediagnosticson:31489824
ja75b849:31512419
7df3h592:31512476
cp_cls_c_1082:31504161
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_c_632:31510883
748c7209:31512887
cg448276_tst_on:31511779
32d76977:31512328
ha629193:31508444
539gd155_c:31506875
e6ac6c27:31509471

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions