Report #12531
[bug\_fix] Virtual environment uses system Python or wrong minor version instead of intended interpreter
Create the venv by explicitly invoking the desired Python binary: \`/usr/bin/python3.11 -m venv .venv\` \(Linux/macOS\) or \`py -3.11 -m venv .venv\` \(Windows\). Do not rely on the \`python3\` alias if it points to a different version.
Journey Context:
Developer has Python 3.8 as system default and Python 3.11 installed. They run \`python3 -m venv myenv\` expecting Python 3.11, but \`which python3\` returns \`/usr/bin/python3\` linked to 3.8. The venv is created with 3.8. Developer installs packages, writes code using \`match\` statements \(3.10\+\), and gets \`SyntaxError\`. They check \`myenv/bin/python --version\` and see 3.8. They try \`pip install --upgrade python\` which fails. Realizing the venv is bound to the interpreter that created it \(PEP 405\), they delete \`myenv\` and recreate using \`python3.11 -m venv myenv\` \(or \`virtualenv -p python3.11 myenv\`\), verifying the binary path with \`ls -la myenv/bin/python\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:15:36.935318+00:00— report_created — created