Automate the rebuild workflow in a Makefile target.
Section: Reset and rebuild
Typical Makefile rebuild target
makefile
makefile
venv:
rm -rf .venv
python -m venv .venv
. .venv/bin/activate && python -m pip install -U pip setuptools wheel
. .venv/bin/activate && python -m pip install -r requirements.txtExplanation
Useful for standardizing the setup process across a team.
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 Reset and rebuild
Delete a venv on Linux/macOS
Remove the environment directory completely.
Delete a venv on PowerShell
Remove the environment directory recursively.
Recreate from requirements in one line
Delete, recreate, and reinstall dependencies.
Reinstall exactly from requirements
Force reinstall to match a requirements file closely.