Report #10099
[bug\_fix] The virtual environment was not created successfully because ensurepip is not available \(Debian/Ubuntu\)
Install the \`python3-venv\` package using \`sudo apt-get install python3-venv\` \(and usually \`python3-pip\`\). This provides the \`ensurepip\` module and \`venv\` support required to bootstrap pip inside new virtual environments.
Journey Context:
Developer creates a \`Dockerfile\` using \`FROM ubuntu:22.04\`, installs \`python3\` and \`python3-pip\` via \`apt-get\`, then runs \`python3 -m venv /opt/venv\`. The command fails with an error stating that \`ensurepip\` is not available and suggests installing the \`python3-venv\` package. The developer realizes that Debian/Ubuntu split the \`venv\` module and \`ensurepip\` \(which venv uses to install pip into new environments\) into a separate package due to distro policies regarding external network access and minimal base installations. Installing \`python3-venv\` resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:49:11.835666+00:00— report_created — created