[FEATURE] Add Python support to official development container
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:
- The Dockerfile doesn't install
python3-venvorpython3-full - Debian Bookworm (the base image) enforces PEP 668, blocking system-wide pip installs
- The firewall blocks
astral.sh, preventing users from installinguvas 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:
- Fork and modify the Dockerfile - Requires maintaining a separate fork
- Add Python devcontainer feature - Requires editing devcontainer.json
- Add
astral.shto firewall allowed domains - Allows installinguv, but requires modifyinginit-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
- User opens a Python project in VS Code with the official Claude Code devcontainer
- User asks Claude to help install dependencies: "install the yfinance package"
- Claude runs
pip install yfinance - Current behavior: Fails with "externally-managed-environment" error
- 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.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗