Skip to content

[Python Environments] Conda environments discovered twice with different path casing on Windows (Miniconda3 vs miniconda3) #1703

Description

@lcsfrey-amat

Type: Bug

Summary

On Windows, pet reports every conda environment twice: once with the real on-disk casing (C:\Users<user>\Miniconda3) and once with an all-lowercase prefix (C:\Users<user>\miniconda3). Both point to the same install. Because Windows is a case-insensitive filesystem, pet's hardcoded lowercase well-known location (miniconda3) resolves to the same folder as the real Miniconda3 install, and the resulting environments are not de-duplicated (dedup appears to be case-sensitive). This surfaces in VS Code as duplicate entries in the interpreter picker / Python Environments view.

Environment

  • OS: Windows 11 Enterprise (case-insensitive NTFS)
  • Install: Miniconda, on-disk folder C:\Users<user>\Miniconda3 (capital M)
  • conda 26.3.2
  • Python extension ms-python.python 2026.4.0
  • Python Environments extension ms-python.vscode-python-envs 1.36.0
  • pet from ms-python.python-2026.4.0-win32-x64/python-env-tools/bin/pet.exe

All authoritative sources use the correct capital casing:

  • conda info → base C:\Users<user>\Miniconda3
  • %PATH% (user + system) → ...\Miniconda3, ...\Miniconda3\Scripts
  • ~/.conda/environments.txt → all ...\Miniconda3...
  • .condarc → no path overrides
  • On disk: exactly one folder, Miniconda3 (verified via dir)

There is no miniconda3 (lowercase) folder anywhere.

Reproduction

  1. Install Miniconda to the default Windows location so the folder is C:\Users<user>\Miniconda3 (capital M).
  2. Create a couple of named envs.
  3. Run pet.exe find --list.

Actual behavior

pet find --list emits each environment twice. Prefix lines, filtered:

Prefix : C:\Users<user>\Miniconda3
Prefix : C:\Users<user>\Miniconda3\envs\ap-dev
Prefix : C:\Users<user>\Miniconda3\envs\gpm-ap
Prefix : C:\Users<user>\Miniconda3\envs\gpm-master
Prefix : C:\Users<user>\miniconda3
Prefix : C:\Users<user>\miniconda3\envs\gpm-master
Prefix : C:\Users<user>\miniconda3\envs\ap-dev
Prefix : C:\Users<user>\miniconda3\envs\gpm-ap

4 real environments → 8 reported. The first pass (correct casing) comes from the authoritative conda discovery. A later pass then probes the lowercase path:

0.042s WARN pet_conda::package: Unable to find conda package Python in "C:\Users<user>\Miniconda3\envs\ap-dev", trying slower approach
...
0.373s WARN pet_conda::package: Unable to find conda package Python in "C:\Users<user>\miniconda3\envs\ap-dev", trying slower approach
0.374s WARN pet_conda::package: Unable to fin\Users<user>\miniconda3", trying slowerapproach
0.378s WARN pet_conda::package: Unable to find conda package Conda in "C:\Users<user>\miniconda3", trying slower approach

The lowercase directory names are baked into the binary (found via a raw string scan of pet.exe): miniconda3, anaconda3, miniforge3. These are the well-known conda install directory names in their lowercase (Linux/default) form. On Windows the real installer folder is Miniconda3 (capital), but the lowercase guess still matches on a case-insensitive filesystem.

Expected behavior

On case-insensitive filesystems, environments that resolve to the same physical path should be de-duplicated regardless of casing. A single environment should be reported per real install, using the on-disk canonical casing.

Extension version: 1.36.0
VS Code version: Code 1.132.0 (df53daabb18cd157bdb08c7f01c34df936cf12f4, 2026-08-04T15:30:20Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x25b8 [NVIDIA RTX A2000 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.8142 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x9a60 [Intel(R) UHD Graphics], DRIVER_VERSION=32.0.101.6556
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.22621.7376
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) 15.73GB (3.61GB free)
Process Argv C:\dev\appliedpro_new --log debug --log vscode.github=trace --crash-reporter-id bbaddde9-e55c-4a75-8c2b-8326a9e666c7
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
gh487529:31544284
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ddidtcf:31399634
ec5jj548:31422691
prod-compl-treat:31557635
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
ge8j1254_inline_auto_hint_haiku:31490510
cp_cls_c_1081:31454833
conptydll_true:31498968
core-renderer-profiling-on:31440367
e9c30283:31461165
test_control1:31471004
c9b86496:31447327
capico_a_098a3278:31555650
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
89g7j272:31518289
7e187181:31503455
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
jh5f2457_c:31540921
g4a0e106:31529594
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
nes-curr-leftover-1500:31538366
ahp-both-windows:31556933
h561g132:31533256
session_8:31532895
ihg5j128:31534457
f412h606:31551416
9gg7f176:31542112
max-result-20:31551156
enable_editor_pane_layout:31554332
allow-none:31555437
fd5dc207:31551400
c7c27ce7:31554789
nes-gb3-nf-6k:31554346
8hc4g144:31558143
0dg73464:31554319
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
switchtoauto:31559321
vrbsty_tr:31561058
session-mark-done:31558131

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions