Report #46745
[bug\_fix] Venv using system Python or wrong architecture / --system-site-packages leakage
Recreate the virtual environment explicitly specifying the Python interpreter version: \`rm -rf venv/ && python3.10 -m venv venv\` \(verify with \`ls -la venv/bin/python\`\). Ensure the \`--system-site-packages\` flag was not used during creation.
Journey Context:
Developer on Ubuntu 22.04 runs \`python3 -m venv venv\`. They activate it with \`source venv/bin/activate\` and run \`python --version\`, which shows 3.8 instead of the system 3.10. They check \`which python\` and see \`/usr/bin/python\`. They discover \`/usr/bin/python3\` was symlinked to \`python3.8\` via \`update-alternatives\`, or they previously had a \`venv\` folder created with a different Python version and didn't recreate it. Alternatively, they see packages like \`numpy\` available in the venv even though they never installed them, indicating \`--system-site-packages\` was used, breaking isolation. The fix requires explicitly calling the desired python binary: \`/usr/bin/python3.10 -m venv new\_venv\` to ensure the symlink \`venv/bin/python\` points to the correct binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:56:03.367078+00:00— report_created — created