Report #95499
[bug\_fix] /bin/python3: No module named pip / The virtual environment was not created successfully because ensurepip is not available
Install the python3-venv \(or python3.11-venv for specific versions\) apt package using 'sudo apt install python3-venv'. Root cause: Debian and Ubuntu disable the ensurepip module in the core python3 package for policy reasons \(avoiding duplication with apt\), so the venv module cannot bootstrap pip unless the separate python3-venv package provides the ensurepip module and pip wheel files.
Journey Context:
Developer on Ubuntu 22.04 runs 'sudo apt install python3' then 'python3 -m venv myenv'. The command succeeds but emits a warning: 'The virtual environment was not created successfully because ensurepip is not available'. They activate the environment and try 'pip install requests', receiving 'bash: myenv/bin/pip: No such file or directory'. They check 'ls myenv/bin/' and see only 'python' and 'python3'. They search Stack Overflow and see advice to install 'python3-pip' \(system-wide\), which doesn't help the venv. They try 'python3 -m ensurepip --upgrade' and get 'No module named ensurepip'. Eventually they find the Debian Python Policy documentation stating that ensurepip is disabled by default and requires the 'python3-venv' package. Installing that package provides the wheel files for pip and the ensurepip module, allowing venv to create fully functional environments with pip included.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:52:24.078290+00:00— report_created — created