pip backup requirements lib in original env
Standard Virtual Environment (venv or virtualenv)
The "original" and most common way to back up a virtual environment is not to copy the folder itself (which often breaks due to hardcoded paths), but to "freeze" its state into a list of dependencies.
- Export (Backup): Run this command inside your activated environment.This creates a file named
requirements.txtcontaining every package and its exact version. - Restore: To recreate the environment elsewhere, create a new
venvand run:
留言
發佈留言