Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix broken python links in venv
# Fix borken python links in all venv
cd ~/.virtualenvs
for i in `workon`
do
if [ $(find $i/ -type l | tail -n 1 | grep "python3") ]; then
echo "$i python3"
find $i/ -type l -delete
virtualenv $i --python=python3
else
echo "$i python2"
find $i/ -type l -delete
virtualenv $i --python=python2
fi
done
# Uninstall all venv local pip
for i in `workon`
do
workon $i
if [ $(which pip | grep '.virtual') ]; then
pip uninstall pip -y
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment