How to migrate virtualenvs when system python version changes

eg from 3.5 to 3.6

Not foolproof, but a quick hack

# In your old virtual site-packages directory
# with your new virtualenv activated

pip install `find . -mindepth 1 -maxdepth 1 -type d | egrep -v "(info|egg)$" | egrep -v "(pycache|pkg_resources)" | sed -e 's#./##g'`

Leave a Reply

Your email address will not be published. Required fields are marked *