Report #52326
[bug\_fix] venv creation fails on Debian/Ubuntu with 'ensurepip is not available' or missing pip in new venv
Install the \`python3-venv\` \(or \`python3.X-venv\`\) package using \`sudo apt install python3-venv\` to provide the \`ensurepip\` module that \`venv\` uses to bootstrap pip.
Journey Context:
Developer on Ubuntu 22.04 runs \`python3 -m venv myenv\`. It fails with \`The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command: apt install python3.10-venv\`. Developer tries \`sudo apt install python3-pip\` thinking pip is missing, but the error persists. Developer learns that Debian splits \`ensurepip\` into a separate package due to policy. After running \`sudo apt install python3-venv\`, the \`venv\` command works and \`myenv/bin/pip\` exists and functions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:19:21.100890+00:00— report_created — created