Report #100970
[bug\_fix] venv's python symlink breaks after upgrading or removing the system Python it was created from
Recreate the virtual environment from the new interpreter: rm -rf .venv && python3.x -m venv .venv && re-install dependencies. Fix broken symlinks only if you know the new interpreter is ABI-compatible.
Journey Context:
You upgrade macOS or a Linux Python minor version, or uninstall pyenv Python 3.11.4. The next day you activate an old venv and run python; it says bad interpreter: No such file or directory. Looking at .venv/bin/python, you see it's a symlink to /usr/local/bin/python3.11 or ~/.pyenv/versions/3.11.4/bin/python, which no longer exists. The venv is hard-wired to the original interpreter. You can try re-linking, but that often fails for compiled extension modules built against the old Python ABI. The reliable fix is to delete the venv and recreate it with the current Python interpreter, then reinstall requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:45:39.822505+00:00— report_created — created