Skip to content

Startup stalls and Python environments appear missing during activation #1434

Description

Problem

When VS Code opens a Python workspace, the extension can stall during startup and some environment managers fail to register. Users then see missing or incorrect Python environments until reload.

What users might see

  • Slow startup or temporary UI freeze when opening a project
  • High CPU during startup
  • Environment list missing expected entries (especially non-system managers)
  • Environment selection/activation not working right away
  • In some cases, repeated terminal/process churn

How it arises

  • On activation, multiple managers register in parallel.
  • Some managers fall back to PET-based detection during registration.
  • If PET is still cold/initializing (common on slower, remote, or containerized setups), requests can timeout.
  • Timeout/retry behavior can cascade, leaving managers unregistered for that session.

Steps to reproduce

  • Open a Python project in a fresh VS Code session.
  • Use a machine/workspace with slower startup conditions (remote, container, or heavy load).
  • Wait for Python Environments extension activation.
  • Open the environment picker/tree.
  • Observe startup delay and potentially missing managers/environments.
  • Expected behavior
  • Startup remains responsive and manager registration does not block or fail; environments appear reliably.

Actual behavior

  • Startup can hang briefly, and some managers/environments are unavailable until another refresh or reload.

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    importantIssue identified as high-priority
    on Apr 3, 2026
  2. eleanorjboyd commented on Apr 3, 2026

    @eleanorjboyd
    MemberAuthor

    through detailed investigation, my hypothesis is that this PR will fix it. #1423 or at least dramatically improve results. Will watch for user input on if this change leads to improvement

  3. flying-sheep commented on Apr 26, 2026

    @flying-sheep
    Contributor

    Is this issue what causes popups saying something that “the flying-sheep.hatch:hatch environment manager can’t be found” even though my extension has a 80ms startup time?

    This really needs to be fixed as it results in another env manager stealing the configured hatch environment (i.e. the venv one), which then causes the workspace settings to be updated with "python-envs.defaultEnvManager": "ms-python.python:venv" against user choice.

  4. flying-sheep commented on Apr 28, 2026

    @flying-sheep
    Contributor

    I see this popup a lot with my extension, despite the short startup time. Any advice? I have the "onLanguage:python" activation event just like this extension.

  5. flying-sheep commented on May 10, 2026

    @flying-sheep
    Contributor

    I filed #1517 in case this is a different issue.

  6. flying-sheep commented on Sep 24, 2026

    @flying-sheep
    Contributor

    yeah this looks fixed, thank you for all the work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityinfo-neededIssue requires more information from postermeta

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions