Skip to content

Instantly share code, notes, and snippets.

@stripe-q
Created October 20, 2016 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stripe-q/c8d3731c9ba786e98a47d1c479f23875 to your computer and use it in GitHub Desktop.
Save stripe-q/c8d3731c9ba786e98a47d1c479f23875 to your computer and use it in GitHub Desktop.
update all pip packages (shell)
#!/bin/bash
packs=($(pip list | awk '{ print $1 }'))
length=${#packs[@]}
num=1
for p in "${packs[@]}
do
echo "[$num / $length]: update package: $p"
pip install -U $p
num=$(( $num + 1 ))
done
# also, you can do that in one-liner.
for p in "$(pip list | awk '{ print $1 }')"; do pip install -U $p; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment