Report #104491
[bug\_fix] ModuleNotFoundError: No module named 'pip' \(inside venv on Windows with Python 3.12\+\)
Recreate the venv with the \`--without-pip\` flag removed, or install pip manually using \`python -m ensurepip --upgrade\`. Alternatively, use the \`venv\` module with Python 3.12\+ where pip is not bundled by default on some systems.
Journey Context:
A developer on Windows created a virtual environment using \`python -m venv myenv\` and then activated it. When they tried \`pip list\`, they got \`ModuleNotFoundError: No module named 'pip'\`. They had Python 3.12.2 installed via the official installer, which by default does not include pip in the venv due to a change in Python 3.12: \`ensurepip\` is still available but pip may not be installed automatically depending on configuration. The developer checked \`myenv\\Scripts\\python -m ensurepip --default-pip\` and then ran \`python -m ensurepip --upgrade\` which installed pip. Alternatively, they recreated the venv with \`python -m venv --without-pip myenv\`? Actually the default is to include pip; but on some systems the \`ensurepip\` bootstrap might fail if pip is not available. The root cause: Python 3.12\+ changed the venv creation to rely on \`ensurepip\`, which can fail silently if the system has restrictions. The fix is to explicitly run \`ensurepip\` or use a virtual environment tool like \`virtualenv\` that bundles pip. This is documented in Python's venv changelog.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-23T20:07:41.838262+00:00— report_created — created