Report #72471
[bug\_fix] Virtual environment creation fails on Debian/Ubuntu with 'ensurepip is not available' or missing pip
Install the operating system package \`python3-venv\` \(and \`python3-pip\`\) using apt \(\`sudo apt install python3-venv\`\), then recreate the virtual environment.
Journey Context:
Developer on a fresh Ubuntu 22.04 server or WSL instance runs \`python3 -m venv myenv\`. The command outputs error: "The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package...". Developer might have installed \`python3\` but not the venv module. If they force creation with \`--without-pip\`, activating the env reveals no \`pip\` binary. Attempting \`python -m pip\` fails with no module named pip. Debugging involves \`dpkg -l \| grep python\` showing \`python3\` installed but \`python3-venv\` missing. Fix is \`sudo apt update && sudo apt install python3-venv -y\`, then \`rm -rf myenv && python3 -m venv myenv\`. Now \`myenv/bin/pip\` exists.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T04:13:57.861254+00:00— report_created — created