Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Users without Python installations were shown "Create Virtual Environment" in the interpreter picker, leading to confusing failures. This prevented them from understanding why environment creation failed repeatedly.

Changes

  • Python detection: Check system manager for available Python installations before rendering picker options
  • Conditional UI: Show warning message when no Python detected; show create option only when Python exists
  • Fallback preserved: "Browse..." option remains available in all cases for manual Python location

Implementation

Detection uses system manager ID to query for global Python installations:

const systemManager = managers.find((m) => m.id === 'ms-python.python:system');
const systemPythons = systemManager ? await systemManager.getEnvironments('all') : [];
const hasPython = systemPythons.length > 0;

if (hasPython) {
    items.push({
        label: Interpreter.createVirtualEnvironment,
        iconPath: new ThemeIcon('add'),
    });
} else {
    items.push({
        label: Interpreter.noPythonInstalled,
        description: Interpreter.noPythonInstalledDescription,
        iconPath: new ThemeIcon('warning'),
    });
}

Before: Browse... | Create Virtual Environment...
After (no Python): Browse... | ⚠️ No Python Detected
After (has Python): Browse... | Create Virtual Environment...

Original prompt

This section details on the original issue you should resolve

<issue_title>Show warning that python isnt installed in select interpreter and/or create environment quick pick</issue_title>
<issue_description>Observed a user navigate to the Select Interpreter status bar item when a python wasnt select and they were shown Create Environment and Enter Interpreter path.

I dont think we should show Create Environment here unless one of the supported managers has a way to bring a Python in the process. It would be nice to also have a warning in this drop down that Python is not detected. Users got stuck in this process and just trying to create environments over and over again

Image
</issue_description>

<agent_instructions>if a user goes to this menu:

  • check to see if they have python installed like at all
  • if they DON't show an error message about that
  • if they do then the create virtual environment should be good!</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 10, 2025 05:13
- Add localized warning strings for no Python detected
- Modify pickEnvironment to check system manager for Python installations
- Show warning message when no Python detected instead of Create Environment option
- Add comprehensive unit tests for the new behavior
- All existing tests pass

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Use proper QuickPickItem type instead of any
- Use readonly array types
- Add unknown type conversion for test mocks

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Use manager ID 'ms-python.python:system' instead of magic string for name
- Add comment explaining the system manager check
- Update all test mocks to include manager ID

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Add warning for missing Python installation in interpreter selection Hide "Create Virtual Environment" when Python not installed Dec 10, 2025
Copilot AI requested a review from eleanorjboyd December 10, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show warning that python isnt installed in select interpreter and/or create environment quick pick

2 participants