-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
When no Python interpreter is found on the user's machine, offer to install Python using uv - a fast, cross-platform Python installer and package manager.
Motivation
Users new to Python or setting up a fresh machine often don't have Python installed. Currently, they need to manually install Python before using the extension. We can streamline this experience by leveraging uv to automatically install Python.
Proposed Behavior
Scenario 1: No Python found, no uv found
- Detect that no Python interpreter is available
- Prompt user: "No Python found. Would you like to install Python using uv?"
- If user agrees:
- Install
uvusing platform-appropriate method:- Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows:
- Run
uv python installto install the latest Python version
- Install
- Refresh environment detection
Scenario 2: No Python found, uv already installed
- Detect that no Python interpreter is available but
uvis present - Prompt user: "No Python found. Would you like to install Python using uv?"
- If user agrees:
- Run
uv python installto install the latest Python version
- Run
- Refresh environment detection
Benefits of using uv
- Cross-platform: Single consistent approach for Windows, macOS, and Linux
- No bootstrap problem: uv can install Python without requiring Python first
- Fast: Rust-based, significantly faster than traditional installers
- Multiple versions: Users can later install additional Python versions with
uv python install 3.x - Maintained: Actively developed by Astral (creators of Ruff)
Implementation Considerations
- Detect if
uvis already installed (check PATH) - Handle installation failures gracefully
- Consider allowing user to choose Python version (optional enhancement)
- Update environment detection after installation
- Consider adding a "Don't ask again" option
- Ensure terminal visibility so users can see installation progress
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request