Report #58915
[bug\_fix] Venv bad interpreter: /original/path/to/python: No such file or directory \(after moving venv directory\)
Delete and recreate the virtual environment in the new location. Virtual environments embed absolute paths in shebang lines \(bin/pip, bin/activate\) and pyvenv.cfg.
Journey Context:
Developer creates a venv at /home/alice/project/venv, installs packages, then renames the directory to /home/alice/project-old or scp's it to /home/bob/project. They source venv/bin/activate. The $VIRTUAL\_ENV variable and shebang lines in venv/bin/pip still point to /home/alice/project/venv/bin/python, which doesn't exist on Bob's machine or at the new path. Running pip gives "bad interpreter: No such file or directory". Even if they manually fix the activate script, pyvenv.cfg contains "home = /usr/bin" \(the original Python's location\) which can cause issues if the new system has Python in a different location.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:22:28.348711+00:00— report_created — created