Report #9295
[bug\_fix] ModuleNotFoundError: No module named 'pip' immediately after activating a fresh venv on Debian/Ubuntu
Install the \`python3-venv\` system package using \`sudo apt install python3-venv\`, which provides the \`ensurepip\` module, then recreate the virtual environment.
Journey Context:
Developer on a fresh Ubuntu 22.04 LTS runs \`python3 -m venv myenv\`. The command completes successfully. They activate with \`source myenv/bin/activate\` and attempt \`pip install requests\`. They receive 'pip: command not found' and \`python -m pip\` fails with ModuleNotFoundError. Investigating \`myenv/bin/\` shows no \`pip\` executable. This occurs because Debian and Ubuntu disable the \`ensurepip\` module \(which bootstraps pip into venvs\) in their Python builds for policy reasons—preventing vendored copies of pip. The \`venv\` module creates the environment but cannot install pip without \`ensurepip\`. Installing the \`python3-venv\` Debian package restores the \`ensurepip\` module, allowing \`python3 -m venv\` to correctly bootstrap pip into new environments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:46:54.713798+00:00— report_created — created