Report #102416
[bug\_fix] Packages installed in a venv are missing, or scripts run with the system Python despite activation
Create the venv explicitly with the interpreter you intend to use: \`python3 -m venv .venv\` \(or \`py -3 -m venv .venv\` on Windows\). On Debian/Ubuntu use \`python3 -m venv\`, not \`virtualenv\` from an apt package unless you know what you are doing. Always run the venv's Python directly \(\`./.venv/bin/python\`\) or activate the environment so \`$PATH\` resolves \`python\` and \`pip\` to the venv copies.
Journey Context:
On an Ubuntu CI image you run \`python -m venv .venv\` because the tutorial said so, but \`python\` is symlinked to \`python2.7\` via the \`python-is-python2\` package. The venv is created with Python 2.7, yet your code uses f-strings and fails. Or, you install packages but they land in \`/usr/lib/python3/dist-packages\` because the venv was created with a \`venv\` module that did not actually copy the right interpreter. The rabbit hole is checking \`ls -l .venv/bin/python\` and realizing it points somewhere unexpected. The fix works because \`python3 -m venv\` is unambiguous on systems where \`python\` is ambiguous; it creates the venv from the exact interpreter you name, and that interpreter becomes \`.venv/bin/python\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:50:05.023732+00:00— report_created — created