Hi everyone,
I’m running into issues with the new Docker Sandbox feature and Python environment management. I’m unable to install packages or create virtual environments inside the sandbox.
Here’s what I’m seeing.
pip install fails with “externally-managed-environment”
agent@claude-sandbox-2026-02-11-185529:~/workspace$ python3 -m pip install --user uv
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install python3-xyz
...
hint: See PEP 668 for the detailed specification.
This looks like Debian/Ubuntu’s PEP 668 enforcement.
Creating a venv fails (ensurepip missing)
agent@claude-sandbox-2026-02-11-185529:~/workspace$ python3 -m venv venv
The virtual environment was not created successfully because ensurepip is not available.
On Debian/Ubuntu systems, you need to install the python3.13-venv package.
Installing python3.13-venv is not possible
Without sudo:
apt install python3.13-venv
Error: Could not open lock file /var/lib/dpkg/lock-frontend - Permission denied
With sudo:
sudo apt install python3.13-venv
Package python3.13-venv is not available
Error: Package 'python3.13-venv' has no installation candidate
pyenv is not available
pyenv
bash: pyenv: command not found
Summary
Inside the Docker Sandbox:
- pip install --user is blocked due to PEP 668
- python3 -m venv fails because ensurepip is missing
- apt install python3.13-venv is unavailable
- Installing system packages is restricted
- No pyenv available
This effectively prevents:
- Creating isolated Python environments
- Installing alternative Python versions
- Installing project-specific dependencies
Questions
- Is the Docker Sandbox intentionally designed to prevent creating virtual environments?
- Is there a supported way to:
- Install additional Python versions?
- Create isolated environments?
- Use tools like uv, pipx, or pyenv?
- Is the recommended approach to build a custom image instead of using the provided sandbox image?
Any clarification on the intended workflow for Python development inside Docker Sandbox would be greatly appreciated.
Thanks!