Last active
April 18, 2025 00:54
-
-
Save prehensilecode/bec508685871371052c5c92c0a46ad6e to your computer and use it in GitHub Desktop.
Re-install all pip packages retaining the same version
This file contains hidden or 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
#!/bin/bash | |
# tested on pip 25.0.1 | |
# XXX this is probably not a good idea | |
for pkg in $( python3 -m pip list | tail -n+3 | awk '{print $1 "==" $2}' ) | |
do | |
python3 -m pip install -U --force-reinstall "${pkg}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment