Skip to content

[Bug]: Preview feature python.useEnvironmentsExtension enabled by default breaks valid standalone Python apps (e.g., PsychoPy on macOS) #25888

@ikarugaikoi

Description

@ikarugaikoi

Type: Bug

Description:
I wasted hours troubleshooting what I thought was a broken environment, only to discover that the root cause is a "Preview" feature (python.useEnvironmentsExtension) being enabled by default.

The new environment detection logic is extremely fragile and completely fails to recognize valid Python executables packaged inside macOS .app bundles (specifically, the widely used academic software PsychoPy). Forcing an experimental, half-baked detection mechanism on users by default is highly disruptive and frustrating.

Environment:

OS: macOS 26.4(25E246)

VS Code version: Version: 1.113.0

Python Extension version: 2026.4.0

Target software: StandalonePsychoPy-2026.1.2-macos-3.10 & v2025.2.4.beta

Steps to Reproduce:

Install PsychoPy for macOS (which comes with its own standalone Python environment packed inside the .app).

Open a Python project in VS Code.

Attempt to manually set the interpreter path to: /Applications/PsychoPy.app/Contents/MacOS/python

VS Code immediately rejects it with the error: "Selected file is not a valid Python interpreter".

Expected Behavior:
VS Code should accept the provided absolute path as a valid interpreter, just like the legacy detection mechanism did, allowing users to run their scripts and use language features.

Actual Behavior:
The new environments extension aggressively pre-checks the executable, fails (likely due to missing context/environment variables specific to the .app bundle), and outright blocks the user from selecting it.

Workaround (The Proof):
The moment I disabled the setting python.useEnvironmentsExtension (unchecking the preview feature) and reloaded the window, the exact same path was accepted perfectly, and my code ran without any Fatal Python error or interpreter rejections.

Why this is a critical issue:
Preview features should be opt-in, not opt-out. By making this the default behavior, you are breaking the workflow of countless researchers and developers who rely on specialized, packaged Python environments. Please fix the detection logic to be more forgiving, or at the very least, revert this to an opt-in setting until it can handle non-standard Python deployments properly.

Extension version: 2026.4.0
VS Code version: Code 1.113.0 (cfbea10c5ffb233ea9177d34726e6056e89913dc, 2026-03-24T15:07:18+01:00)
OS version: Darwin arm64 25.4.0
Modes:

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


languageServer: "Pylance"

terminal
• executeInFileDir: "<placeholder>"

Installed Extensions
Extension Name Extension Id Version
codesnap adp 1.3.4
errorlens use 3.28.0
js-debug ms- 1.112.0
js-debug-companion ms- 1.1.3
jupyter ms- 2025.9.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
markdown-all-in-one yzh 3.6.3
markdown-pdf yza 1.5.0
markdown-preview-enhanced shd 0.8.22
markdown-table-editor oct 0.0.6
python ms- 2026.4.0
r REd 2.8.8
r-syntax REd 0.1.4
remote-containers ms- 0.447.0
theme-dracula dra 2.25.1
vscode-containers ms- 2.4.1
vscode-gutter-preview kis 0.32.2
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-latex mat 2.0.0
vscode-pandoc Chr 0.7.1
vscode-pylance ms- 2026.1.1
vscode-python-envs ms- 1.24.0
vscode-theme-onedark aka 2.3.0
System Info
Item Value
CPUs Apple M2 Max (12 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M2 Max, Version 26.4 (Build 25E246))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.4 ACTIVE
Machine model name: Mac
Machine model version: 14.13
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 6, 5, 5
Memory (System) 32.00GB (0.06GB free)
Process Argv --crash-reporter-id b95e16d1-817b-4e17-b1d1-6bf193e02570
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
pythonvspyt551cf:31249601
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
b6b4d950:31327385
6abeh943:31336334
envsactivate1:31464700
cloudbuttont:31379625
aihoversummaries_f:31469309
42190218_ostrepl:31403339
bj468946:31457056
use-responses-api:31390855
ddidt:31399633
ec5jj548:31422691
cp_cls_c_966_ss:31454199
find_all_ref_in_bg_f:31469307
8hhj4413:31478653
cp_cls_c_1081:31454833
e9c30283:31461165
test_treatment2:31471001
idci7584:31464702
showingstats:31481873
534a6447_copy:31478748
chat:31457767
bg_compact_c:31481651
t-some:31484756
cpptoolsoff-v2:31475362
db0gd219:31481871
23c7c724:31484514
ddid_c:31478207

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