Repository navigation
Python Extension Fails to Auto-Detect Venv on SMB Network Drive #25526
Copy link
Copy link
Closed as not planned
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsinfo-neededIssue requires more information from posterIssue requires more information from poster
Description
We have written the needed data into your clipboard because it was
Type: Bug
Hi all
Issue Title:
Python Extension Fails to Auto-Detect Venv on SMB Network Drive (Z:) with ENOENT Scandir Error in AppData
Environment
- VS Code Version: 1.95.0 (or latest as of October 13, 2025)
- Python Extension Version: 2025.16.0
- Python Version: 3.13.4 (global and in venv)
- OS and Version: Windows 11 (or your version), 64-bit
- Relevant Extensions: ms-python.python (2025.16.0), ms-python.debugpy (2025.14.0), ms-python.pylance (2025.8.3)
- Other Info: Project on SMB-mapped network drive (Z:, not local C:). No Poetry/Conda/Pixi used – plain
python -m venv .venv.
Steps to Reproduce
- Create a new project folder on a network drive, e.g.,
Z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK. - In PowerShell (project root):
python -m venv .venv(creates venv successfully;Test-Path .\.venv\Scripts\python.exereturns True). - Activate venv:
.\.venv\Scripts\Activate.ps1>pip install requests> Deactivate. (Venv works:python -c "import requests; print(requests.__version__)"outputs 2.32.5.) - Create
.vscode/settings.json:{ "python.defaultInterpreterPath": "./.venv/Scripts/python.exe", "python.terminal.activateEnvironment": true } - Open VS Code in the folder:
code .(from PowerShell in root). - Status bar shows "Select Interpreter" triangle. Command Palette > "Python: Select Interpreter" > Enter absolute path
Z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK\.venv\Scripts\python.exe– selects successfully, status bar updates to correct path. - Create
src/main.pywith sample code (e.g.,import requests; response = requests.get('https://api.github.com'); print(response.status_code)). - Press F5 on main.py: Debugger starts, but logs show warnings/errors.
Expected Behavior
- Venv auto-detected from relative path in settings.json.
- No scan errors; status bar updates automatically.
- F5 debugs using venv interpreter without manual selection or launch.json tweaks.
- Terminal auto-activates venv with
(.venv)prefix.
Actual Behavior
- "Select Interpreter" triangle persists until manual absolute path selection.
- Logs (Output > Python) show repeated warnings:
(Extension scans wrong AppData path instead of Z:\ project.)
[warning] Identifier for virt-virtualenv failed to identify .venv\Scripts\python.exe [Error: ENOENT: no such file or directory, scandir 'C:\Users\tuzi\AppData\Local\Programs\Microsoft VS Code\.venv\Scripts'] { errno: -4058, code: 'ENOENT', syscall: 'scandir', path: 'C:\\Users\\tuzi\\AppData\\Local\\Programs\\Microsoft VS Code\\.venv\\Scripts' } - Additional warning:
Dir "z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK\.pixi\envs" is not watchable (directory does not exist)– scans for non-existent Pixi envs. - F5 prompts "Select Debugger" loop: "Python Debugger" > "Python File" > "create a launch.json file" > Loops back to config menu.
- Manual
launch.jsoncreation in.vscodewith absolute "python" path fixes F5, but relative paths fail. - Terminal activates venv manually, but auto-activation inconsistent.
Logs (from Output > Python, after Reload Window)
2025-10-13 01:56:43.567 [warning] Identifier for virt-virtualenv failed to identify .venv\Scripts\python.exe [Error: ENOENT: no such file or directory, scandir 'C:\Users\tuzi\AppData\Local\Programs\Microsoft VS Code\.venv\Scripts'] {
errno: -4058,
code: 'ENOENT',
syscall: 'scandir',
path: 'C:\\Users\\tuzi\\AppData\\Local\\Programs\\Microsoft VS Code\\.venv\\Scripts'
}
2025-10-13 01:56:43.908 [info] Finished searching for windows registry interpreters: 589 milliseconds
2025-10-13 01:56:43.910 [info] Environments refresh paths discovered (event): 591 milliseconds
2025-10-13 01:56:43.910 [info] Environments refresh paths discovered: 591 milliseconds
2025-10-13 01:56:43.958 [info] Environments refresh finished (event): 639 milliseconds
2025-10-13 01:56:43.965 [info] Environment refresh took 647 milliseconds
2025-10-13 01:56:52.885 [info] Active interpreter [z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK]: Z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK\.venv\Scripts\python.exe
2025-10-13 01:56:52.909 [info] Python interpreter path: .\.venv\Scripts\python.exe
2025-10-13 01:56:52.910 [info] Discover tests for workspace name: PY_Test_with_GROK - uri: z:\0400 Dokumentation\0001 IT D
2025-10-13 02:14:57.902 [info] Telemetry level is off
2025-10-13 02:14:57.902 [info] Experiments are disabled, only manually opted experiments are active.
2025-10-13 02:14:57.902 [warning] Dir "z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK\.pixi\envs" is not watchable (directory does not exist)
2025-10-13 02:14:58.110 [info] Python interpreter path: .\.venv\Scripts\python.exe
2025-10-13 02:14:58.141 [info] > pyenv which python
2025-10-13 02:14:58.141 [info] cwd: z:\0400 Dokumentation\0001 IT Dokumentation\0001 Skripte\PY_Test_with_GROK
2025-10-13 02:15:02.724 [info] Starting Pylance language server.
Additional Notes
- Manual absolute path in settings.json and launch.json works as workaround, but relative paths (./.venv) fail on SMB.
- Similar to My file wrongly autodetected as Javascript instead of Javascript React vscode#24525 (poetry on X:\ with .pixi\envs ENOENT), but reproducible with plain venv – may be dupe or extension.
Greetings
Don Jayamanne (@DonJayamanne)
Brett Cannon (@brettcannon)
VS Code version: Code 1.105.0 (03c265b1adee71ac88f833e065f7bb956b60550a, 2025-10-08T14:09:35.891Z)
OS version: Windows_NT x64 10.0.26100
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 7 5700U with Radeon Graphics (16 x 1797) |
| GPU Status | 2d_canvas: enabled 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 vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 31.34GB (18.74GB free) |
| Process Argv | Z:\ --goto Z:\status.md |
| Screen Reader | no |
| VM | 0% |
Extensions (17)
| Extension | Author (truncated) | Version |
|---|---|---|
| emojisense | bie | 0.10.0 |
| markdown-preview-github-styles | bie | 2.2.0 |
| gitlens | eam | 17.6.1 |
| vscode-containers | ms- | 2.2.0 |
| black-formatter | ms- | 2025.2.0 |
| debugpy | ms- | 2025.14.0 |
| isort | ms- | 2025.0.0 |
| pylint | ms- | 2025.2.0 |
| python | ms- | 2025.16.0 |
| vscode-pylance | ms- | 2025.8.3 |
| powershell | ms- | 2025.4.0 |
| vsliveshare | ms- | 1.0.5959 |
| autodocstring | njp | 0.6.1 |
| material-icon-theme | PKi | 5.27.0 |
| LiveServer | rit | 5.7.9 |
| markdowntable | Tak | 0.13.0 |
| markdown-all-in-one | yzh | 3.6.3 |
Reactions are currently unavailable
Metadata
Metadata
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsinfo-neededIssue requires more information from posterIssue requires more information from poster
Activity
DonJayamanne commentedon Oct 13, 2025
Eleanor Boyd (@eleanorjboyd) looks like this user doesn't have Python Environment extension. any idea how thats possible (I thought we ship this to everyone)?
Alpeflug Please can you
Run Python Environment Tool (PET) in terminal...--verboseoptioneleanorjboyd commentedon Oct 14, 2025
try adding the setting
python.useEnvironmentsExtension: trueto your settings as well- this setting controls if you see the environments extension as it is still under an experiment as a rollout measureAlpeflug commentedon Oct 17, 2025
Hello
Don Jayamanne (@DonJayamanne)
install the "Python Environment extension" --> Done
OT:
The Error ahs a long History:
https://stackoverflow.com/questions/66869413/visual-studio-code-does-not-detect-virtual-environments
And the Extensions is quite new:
Released on 10.12.2024, 20:22:05
Last updated 14.10.2025, 12:41:29
Eleanor Boyd (@eleanorjboyd)
No way - sorry...
Greetings
github-actions commentedon Nov 17, 2025
Hey Karthik Nadig (@karthiknadig) Eleanor Boyd (@eleanorjboyd), this issue might need further attention.
Alpeflug, you can help us out by closing this issue if the problem no longer exists, or adding more information.
eleanorjboyd commentedon Dec 8, 2025
Hi! Could you clarify what you see now with the python environments extension and running
Run Python Environment Tool (PET) in terminal...?github-actions commentedon Jan 8, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!