Skip to content

Instantly share code, notes, and snippets.

@clyang
clyang / backup_venv.sh
Created May 15, 2023 16:02 — forked from ashwinvis/backup_venv.sh
Backup virtualenv before a Python 3.x upgrade and restore / recreate after the upgrade
#!/bin/bash
cd ~
pip freeze --user --exclude-editable > REQUIREMENTS.txt
cd $WORKON_HOME # or wherever you store your virtualenvs
for activate in ./*/bin/activate
do
source $activate
echo $VIRTUAL_ENV