Python venv Troubleshooting Cheat Sheet/Delete and recreate on POSIX

Start fresh from requirements.

Section: Full environment reset

Delete and recreate on POSIX

bash
bash
rm -rf .venv && python -m venv .venv && source .venv/bin/activate && python -m pip install -U pip setuptools wheel && python -m pip install -r requirements.txt
Explanation

Often the fastest and cleanest fix when a venv becomes inconsistent.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Full environment reset
Delete and recreate on PowerShell
Rebuild from scratch on Windows.
OpenIn sheetpowershellsame section
Confirm imports after rebuild
Smoke-test a rebuilt environment quickly.
OpenIn sheetbashsame section
Find python on POSIX
See which python binary your shell resolves first.
Activate using bash syntax
Source the activate script in bash or zsh.
Install bundled pip
Bootstrap pip into the current interpreter or venv.
Find pip on POSIX
See which pip binary your shell resolves first.