Software Tools

Streamlining Python Development: VS Code's New Environments Extension

2026-05-11 22:28:05

Introduction

Python developers working in Visual Studio Code have long faced a fragmented landscape when it comes to managing environments, interpreters, and packages. Tools like venv, conda, pyenv, poetry, and pipenv each offer distinct workflows, often requiring manual configuration and context switching. With the release of the Python Environments extension—now generally available after a year in preview and community refinement—VS Code brings a unified, streamlined approach to environment management. This extension automatically discovers, creates, and manages environments from all major tools, and it works seamlessly alongside the existing Python extension. Over the next few weeks, users will be automatically switched to this new extension, or they can enable it immediately by setting python.useEnvsExtension in their settings.

Streamlining Python Development: VS Code's New Environments Extension
Source: devblogs.microsoft.com

A Unified Environment Experience

The core promise of the Python Environments extension is a single interface for all environment-related tasks, regardless of the underlying tool. It automatically detects environments created by:

  • venv
  • conda
  • pyenv
  • poetry
  • pipenv
  • System Python installations

This discovery is powered by PET (Python Environment Tool), a fast Rust-based scanner that reliably locates environments across Windows, macOS, and Linux. PET checks your system PATH, known installation directories, and any configurable search paths you define. The same engine already handles environment discovery in the existing Python extension, so users benefit from a proven solution with a dedicated user interface. From one place, you can create, delete, switch, and manage environments—no matter which tool originally created them.

Automatic Discovery Out of the Box

For most users, no setup is required. Simply open any Python file, and the extension automatically scans for environments. It works immediately with standard installations. However, if your environments reside in non-standard locations, you can customize the search. The extension supports both workspace-level and global search paths using glob patterns. This flexibility is especially useful for teams with shared directories or custom project structures.

Configurable Search Paths

To add search paths, navigate to the extension settings. You can specify workspace-level paths that apply only to your current project, or global paths that apply to all workspaces. For example, you might add /shared-envs/** to include environments stored in a shared network drive. This ensures that environments outside the typical locations are still discovered and manageable within VS Code.

Faster Environment Creation with uv

Creating new environments can be time-consuming, especially for large projects with many dependencies. The extension integrates with uv, a blazing-fast Python package installer and resolver. If uv is installed on your system, the extension automatically uses it for creating venv environments and installing packages. This is enabled by default via the setting python-envs.alwaysUseUv. For typical projects, uv can reduce creation time from minutes to seconds, significantly speeding up your workflow.

Creating Environments: Quick and Custom

Getting a new environment up and running is now just a click or a command away. The extension provides two primary methods: Quick Create for speed and Custom Create for control.

Quick Create

Click the + button in the Environment Managers view, and the extension builds an environment using your default manager, the latest Python version, and any workspace dependencies it finds in requirements.txt or pyproject.toml. Within seconds, you have a working environment ready for coding. This is ideal for rapid prototyping or when you just need a fresh environment without fuss.

Streamlining Python Development: VS Code's New Environments Extension
Source: devblogs.microsoft.com

Custom Create

When you need more control over the environment configuration, use the Python: Create Environment command from the Command Palette. The Custom Create wizard lets you choose:

  • Environment manager (venv or conda directly; for pyenv, poetry, and pipenv, you create environments via their CLI and the extension will discover them)
  • Python version (select from available interpreters)
  • Environment name
  • Dependency files to install (e.g., requirements.txt, pyproject.toml)

Both venv and conda are supported natively. For other managers like pyenv, poetry, and pipenv, the extension discovers environments you create with their command‑line tools and then integrates them into the unified UI.

Python Projects: Environments That Match Your Code Structure

A common challenge in larger codebases—especially monorepos—is managing multiple environments for different parts of the project. The extension introduces Python Projects, a feature that lets you map environments to specific folders or files. This solves the pain of having to manually switch interpreters when moving between different services or modules.

For instance, if your monorepo contains a web app and a data science pipeline, each with its own dependencies, you can create separate environments and associate them with their respective folders. VS Code will automatically activate the correct environment when you open a file from that folder. This makes it easier to work on multiple sub‑projects within a single workspace without environment conflicts.

Setting up a Python Project is straightforward: right‑click on a folder in the Explorer, select Add Folder to Python Project, and then choose or create an environment for that project. The mapping is saved in a configuration file, ensuring consistency across team members.

Conclusion

The Python Environments extension for VS Code transforms how developers manage their Python setups. By unifying discovery, creation, and management under one roof, it eliminates the friction of tool‑specific workflows. With automatic detection, support for uv for lightning‑fast operations, and the ability to map environments to project structures, this extension is a significant step forward. Whether you are a solo developer or working in a large team with a complex monorepo, the new extension delivers a smoother, more intuitive experience. Enable it today with python.useEnvsExtension and simplify your Python development environment management.

Explore

React Native 0.83 Introduces React 19.2, Advanced DevTools, and More Why Section 230 Is Essential for a Decentralized Social Media Future Snowden Leaks: Former NSA Chief Chris Inglis on Mistakes, Insider Threats, and Media Disclosures Microsoft Agent Framework 1.0 Released: Autonomous AI Agents Now Ready for Production Microsoft Expands Agentic AI Platform for R&D, Reports Real-World Breakthroughs