[FEATURE] Add Python support to official development container

Resolved 💬 4 comments Opened Jan 29, 2026 by coygeek Closed Mar 16, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The official Claude Code devcontainer is built on Node.js 20 and includes no Python virtual environment support. Users working on Python projects cannot use pip to install packages:

pip3 install yfinance
error: externally-managed-environment

× This environment is externally managed

This occurs because:

  1. The Dockerfile doesn't install python3-venv or python3-full
  2. Debian Bookworm (the base image) enforces PEP 668, blocking system-wide pip installs
  3. The firewall blocks astral.sh, preventing users from installing uv as a workaround

Claude Code is commonly used for Python projects (data science, web backends, automation scripts), yet the official devcontainer only supports Node.js development out of the box.

Proposed Solution

Add Python virtual environment support to the official devcontainer Dockerfile:

# Add to the apt-get install block
python3-pip \
python3-venv \

# After USER node, create a venv
RUN python3 -m venv /home/node/.venv
ENV PATH="/home/node/.venv/bin:$PATH"

This would allow users to immediately use pip install without additional configuration.

Alternative approach: Add the Python devcontainer feature in devcontainer.json:

{
  "features": {
    "ghcr.io/devcontainers/features/python:1": {
      "version": "3.11",
      "installTools": true
    }
  }
}

Alternative Solutions

Current workarounds require modifying the devcontainer config:

  1. Fork and modify the Dockerfile - Requires maintaining a separate fork
  2. Add Python devcontainer feature - Requires editing devcontainer.json
  3. Add astral.sh to firewall allowed domains - Allows installing uv, but requires modifying init-firewall.sh

None of these work for users who want to use the official devcontainer as-is.

Priority

Medium - Would be very helpful

Python is one of the most popular languages for Claude Code users (data analysis, automation, ML projects). The current Node.js-only container limits the devcontainer's utility.

Feature Category

Configuration and settings

Use Case Example

  1. User opens a Python project in VS Code with the official Claude Code devcontainer
  2. User asks Claude to help install dependencies: "install the yfinance package"
  3. Claude runs pip install yfinance
  4. Current behavior: Fails with "externally-managed-environment" error
  5. Expected behavior: Package installs successfully into the pre-configured venv

Additional Context

Related issue: This came up in #21373 where a user struggled to use pip in the devcontainer and tried multiple workarounds (installing python3-venv, attempting uv install, trying --break-system-packages) without success.

Current devcontainer docs (code.claude.com/en/devcontainer) describe it as "Production-ready Node.js" with no mention of Python support.

Minimal change: Adding python3-pip and python3-venv to the apt-get install block plus a single RUN python3 -m venv command would solve this for most users.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗