Skip to content

Instantly share code, notes, and snippets.

@keithkim
Created February 13, 2018 23:19
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 keithkim/4856242b3b24dccb6a2c1c2b4bc942ac to your computer and use it in GitHub Desktop.
Save keithkim/4856242b3b24dccb6a2c1c2b4bc942ac to your computer and use it in GitHub Desktop.
Update Python package using pip
# Windows
for /F "delims===" %i in ('pip freeze -l') do pip install -U %i
# or,
for /F "delims= " %i in ('pip list --outdated') do pip install -U %i
# Linux
sudo -H pip install pipdate
sudo -H pipdate
# or,
pip list --outdated --format=legacy | awk '{print $1;}' | xargs -n1 pip install -U
# or,
pip list -o | cut -d " " -f 1 | tail -n +3 | xargs pip install -U
# or,
pip list --format=legacy --outdated | cut -d' ' -f1 | xargs pip install --upgrade
### REFERENCE ###
# https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip
# https://github.com/pypa/pip/issues/3819
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment