Last active
June 16, 2018 03:54
-
-
Save tarunbhardwaj/4e84c86345035c48da7eae8993e42cc1 to your computer and use it in GitHub Desktop.
Fix broken python links in venv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
Explaination https://web.archive.org/web/20150206132233/https://wirtel.be/posts/en/2014/07/29/fix_virtualenv_python_brew/