Skip to content

Environment discovery takes 132s (Using WSL and uv) #1554

Description

@williamlunsom

Environment data

  • Python Environments extension version: 1.30.0
  • Python extension (ms-python.python) version: 2026.4.0
  • VS Code version: 1.122.1
  • OS and version: Windows 11
  • Python version: 3.13
  • Environment manager in use: uv
  • Shell: bash
  • Remote / container scenario: WSL
  • Workspace type (single folder / multi-root / mono-repo): single folder
  • Is this a regression? If yes, last known working extension version: Yes, exact version unknown, but was not an issue in march/april

Repro Steps

  1. Create repo in WSL
  2. Create uv venv
  3. Reload VS code

Relevant .vscode settings.json:

{
  "terminal.integrated.env.linux": {
    "PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/src"
  },
  "terminal.integrated.env.windows": {
    "PYTHONPATH": "${workspaceFolder};${workspaceFolder}/src"
  },
  "terminal.integrated.enablePersistentSessions": false,
  "python-envs.workspaceSearchPaths": [
    "${workspaceFolder}/.venv"
  ],
  "python-envs.defaultEnvManager": "ms-python.python:venv",
  "python.languageServer": "Default",
  "python.analysis.autoImportCompletions": true,
  "python.analysis.extraPaths": [
    "${workspaceFolder}/src"
  ],
  "python.envFile": "${workspaceFolder}/.env",
}

Expected behavior

Discovery happens quickly, since only the uv venv and native python interpreter exists in my system.

Actual behavior

Discovery takes multiple minutes before editor is usable.

Logs

2026-06-02 13:45:08.191 [info] Python-envs extension version: 1.30.0
2026-06-02 13:45:08.191 [info] 
=== Python Envs Configuration Levels ===
2026-06-02 13:45:08.191 [info] {
  "section": "Python Envs Configuration Levels",
  "defaultEnvManager": {
    "workspaceFolderValue": "undefined",
    "workspaceValue": "ms-python.python:venv",
    "globalValue": "undefined",
    "defaultValue": "ms-python.python:venv"
  },
  "defaultPackageManager": {
    "workspaceFolderValue": "undefined",
    "workspaceValue": "undefined",
    "globalValue": "undefined",
    "defaultValue": "ms-python.python:pip"
  }
}
2026-06-02 13:45:08.191 [info] [pet] Starting Python Locator /home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/python-env-tools/bin/pet server
2026-06-02 13:45:08.191 [info] Registering pyenv manager (environments will be discovered lazily)
2026-06-02 13:45:08.191 [info] Registering pipenv manager (environments will be discovered lazily)
2026-06-02 13:45:08.191 [info] Registering poetry manager (environments will be discovered lazily)
2026-06-02 13:45:08.416 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["<<REPO PATH>>"],"environmentDirectories":["<<REPO PATH>>/${workspaceFolder}/.venv"],"pipenvExecutable":"pipenv","poetryExecutable":"poetry","cacheDirectory":"/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2026-06-02 13:45:08.461 [info] Refreshing Pyenv Environments
2026-06-02 13:45:08.461 [info] Refreshing pyenv environments
2026-06-02 13:45:08.461 [info] Refreshing Pipenv Environments
2026-06-02 13:45:08.461 [info] Refreshing pipenv environments
2026-06-02 13:45:08.461 [info] Refreshing Poetry Environments
2026-06-02 13:45:08.461 [info] Refreshing poetry environments
2026-06-02 13:45:08.481 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["<<REPO PATH>>"],"environmentDirectories":["<<REPO PATH>>/${workspaceFolder}/.venv"],"pipenvExecutable":"pipenv","poetryExecutable":"poetry","cacheDirectory":"/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2026-06-02 13:47:15.763 [error] [pet] �[2m   0.500138492s�[0m �[33m WARN�[0m �[2mpet_python_utils::cache�[0m�[2m:�[0m Cache directory has already been set to "/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator". Cannot change it now.

2026-06-02 13:47:15.803 [warning] [pet] Configure request timed out (attempt 1/2), will retry on next request without killing process
2026-06-02 13:47:15.815 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["<<REPO PATH>>"],"environmentDirectories":["<<REPO PATH>>/${workspaceFolder}/.venv"],"pipenvExecutable":"pipenv","poetryExecutable":"poetry","cacheDirectory":"/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2026-06-02 13:47:15.815 [info] [pet] configure: Using extended timeout of 60000ms (retry 1)
2026-06-02 13:47:15.816 [error] Setup appears hung during stage: managerRegistration
2026-06-02 13:47:15.923 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["<<REPO PATH>>"],"environmentDirectories":["<<REPO PATH>>/${workspaceFolder}/.venv"],"pipenvExecutable":"pipenv","poetryExecutable":"poetry","cacheDirectory":"/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2026-06-02 13:47:15.923 [info] [pet] configure: Using extended timeout of 60000ms (retry 1)
2026-06-02 13:47:16.027 [error] [pet] Failed to find handler for method: $/cancelRequest�[2m 121.421199550s�[0m �[33m WARN�[0m �[2mpet_python_utils::cache�[0m�[2m:�[0m Cache directory has already been set to "/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator". Cannot change it now.
�[2m 121.421517126s�[0m �[33m WARN�[0m �[2mpet_python_utils::cache�[0m�[2m:�[0m Cache directory has already been set to "/home/<<USERNAME>>/.vscode-server/data/User/globalStorage/ms-python.vscode-python-envs/pythonLocator". Cannot change it now.

2026-06-02 13:47:16.108 [info] Resolved Python Environment <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:16.192 [error] [pet] �[2m 121.661776696s�[0m �[33m WARN�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Skipping refresh state sync for stale generation 2 because current generation is 4

2026-06-02 13:47:16.198 [info] Resolved Python Environment <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:16.278 [info] Resolved Python Environment <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:16.322 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:16.351 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:16.371 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:16.558 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:16.680 [info] Resolved Python Environment /usr/bin/python3
2026-06-02 13:47:16.776 [warning] [Global] Environment discovery took 128.3s (found 1 environments). If this is causing problems, please report it: https://github.com/microsoft/vscode-python-environments/issues/new
2026-06-02 13:47:16.802 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":264,"breakdown":{"GlobalVirtualEnvs":52,"Locators":256,"Path":264,"Workspaces":89},"locators":{"Conda":255,"Homebrew":0,"LinuxGlobal":26,"PipEnv":51,"Pixi":0,"Poetry":52,"PyEnv":53,"Uv":1,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:16.811 [info] Python API: Changed environment from undefined to <<REPO NAME>> (3.13.13) for: <<REPO PATH>>
2026-06-02 13:47:16.811 [info] Internal: Changed environment from undefined to <<REPO NAME>> (3.13.13) for: <<REPO PATH>>
2026-06-02 13:47:17.051 [info] Resolved Python Environment <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:17.075 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:17.386 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:17.402 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:17.423 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:17.462 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":240,"breakdown":{"GlobalVirtualEnvs":31,"Locators":240,"Path":238,"Workspaces":77},"locators":{"Conda":239,"Homebrew":0,"LinuxGlobal":18,"PipEnv":30,"Pixi":0,"Poetry":33,"PyEnv":32,"Uv":2,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:17.573 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:17.582 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:17.598 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:17.606 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:17.608 [info] Found venv environment: cpython-3.11.15-linux-x86_64-gnu (3.11.15)
2026-06-02 13:47:17.641 [info] Found venv environment: cpython-3.13.13-linux-x86_64-gnu (3.13.13)
2026-06-02 13:47:17.652 [info] Found venv environment: <<REPO NAME>> (3.13.13)
2026-06-02 13:47:17.656 [warning] [venv] Environment discovery took 129.2s (found 3 environments). If this is causing problems, please report it: https://github.com/microsoft/vscode-python-environments/issues/new
2026-06-02 13:47:17.672 [info] Python API: Changed environment from <<REPO NAME>> (3.13.13) to <<REPO NAME>> (3.13.13) for: <<REPO PATH>>
2026-06-02 13:47:17.672 [info] Internal: Changed environment from <<REPO NAME>> (3.13.13) to <<REPO NAME>> (3.13.13) for: <<REPO PATH>>
2026-06-02 13:47:17.966 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":324,"breakdown":{"GlobalVirtualEnvs":44,"Locators":297,"Path":323,"Workspaces":99},"locators":{"Conda":297,"Homebrew":0,"LinuxGlobal":22,"PipEnv":41,"Pixi":0,"Poetry":44,"PyEnv":44,"Uv":2,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:18.033 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:18.089 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:18.299 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:18.357 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:18.692 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":255,"breakdown":{"GlobalVirtualEnvs":29,"Locators":237,"Path":254,"Workspaces":78},"locators":{"Conda":236,"Homebrew":0,"LinuxGlobal":16,"PipEnv":42,"Pixi":0,"Poetry":33,"PyEnv":31,"Uv":3,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:19.273 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:19.331 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:19.333 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:19.335 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:19.434 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":267,"breakdown":{"GlobalVirtualEnvs":33,"Locators":267,"Path":265,"Workspaces":87},"locators":{"Conda":266,"Homebrew":0,"LinuxGlobal":18,"PipEnv":36,"Pixi":0,"Poetry":46,"PyEnv":33,"Uv":2,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:19.520 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/bin/python
2026-06-02 13:47:19.537 [info] Discovered env: /home/<<USERNAME>>/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/bin/python
2026-06-02 13:47:19.543 [info] Discovered env: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:19.544 [info] Discovered env: /usr/bin/python3
2026-06-02 13:47:19.675 [info] Pipenv not found via settings, cache, or PATH
2026-06-02 13:47:19.675 [info] Found 0 pipenv environments
2026-06-02 13:47:19.691 [info] Poetry executable not found
2026-06-02 13:47:19.892 [info] Conda not found, turning off conda features. [Error: Conda not found
  at F (/home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/dist/extension.js:2:607042)
  at runNextTicks (node:internal/process/task_queues:64:5)
  at process.processImmediate (node:internal/timers:452:9)
  at async L (/home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/dist/extension.js:2:607167)
  at async t.registerCondaFeatures (/home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/dist/extension.js:2:627092)
  at async t.safeRegister (/home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/dist/extension.js:2:282415)
  at async Promise.all (index 1)
  at async Immediate.<anonymous> (/home/<<USERNAME>>/.vscode-server/extensions/ms-python.vscode-python-envs-1.30.0-linux-x64/dist/extension.js:2:752995)]
2026-06-02 13:47:19.893 [info] [interpreterSelection] Applying initial environment selection for 1 workspace folder(s)
2026-06-02 13:47:19.904 [info] [pet] Telemetry:  {"event":"RefreshPerformance","data":{"refreshPerformance":{"total":291,"breakdown":{"GlobalVirtualEnvs":26,"Locators":261,"Path":291,"Workspaces":97},"locators":{"Conda":260,"Homebrew":0,"LinuxGlobal":12,"PipEnv":25,"Pixi":0,"Poetry":30,"PyEnv":26,"Uv":3,"Venv":0,"VirtualEnv":0,"VirtualEnvWrapper":0}}}}
2026-06-02 13:47:19.915 [info] Refreshing pyenv environments
2026-06-02 13:47:19.928 [info] Pipenv not found via settings, cache, or PATH
2026-06-02 13:47:19.929 [info] Refreshing pipenv environments
2026-06-02 13:47:19.938 [info] Refreshing poetry environments
2026-06-02 13:47:19.948 [info] [interpreterSelection] <<REPO NAME>>: <<REPO NAME>> (3.13.13) (source: defaultEnvManager)
2026-06-02 13:47:19.948 [info] [interpreterSelection] Workspace env resolved, deferring global scope to background
2026-06-02 13:47:20.135 [info] [interpreterSelection] global: Python 3.12.3 (source: defaultEnvManager)
2026-06-02 13:47:20.145 [info] Terminal is activated: <<REPO PATH>>/.venv/bin/python
2026-06-02 13:47:20.158 [info] Python API: Changed environment from undefined to Python 3.12.3 for: global
2026-06-02 13:47:20.158 [info] Internal: Changed environment from undefined to Python 3.12.3 for: global
2026-06-02 13:47:20.272 [info] Pipenv not found via settings, cache, or PATH
2026-06-02 13:47:20.272 [info] Found 0 pipenv environments
2026-06-02 13:47:20.385 [info] Poetry executable not found
2026-06-02 13:47:20.726 [warning] [PyEnv] Environment discovery took 132.3s (found 0 environments). If this is causing problems, please report it: https://github.com/microsoft/vscode-python-environments/issues/new
2026-06-02 13:47:20.751 [info] Pipenv not found via settings, cache, or PATH
2026-06-02 13:47:20.753 [warning] [Pipenv] Environment discovery took 132.3s (found 0 environments). If this is causing problems, please report it: https://github.com/microsoft/vscode-python-environments/issues/new
2026-06-02 13:47:20.785 [info] Environment discovery complete: 4 environments found (Global: 1, venv: 3)
2026-06-02 13:47:20.785 [warning] [Poetry] Environment discovery took 132.3s (found 0 environments). If this is causing problems, please report it: https://github.com/microsoft/vscode-python-environments/issues/new

Additional context

This happens across multiple repositories, but all are using WSL and uv.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions