Skip to content

Instantly share code, notes, and snippets.

@aaronzs
Last active August 29, 2015 14:05
Show Gist options
  • Save aaronzs/37f32c4a9b9d6faeb64b to your computer and use it in GitHub Desktop.
Save aaronzs/37f32c4a9b9d6faeb64b to your computer and use it in GitHub Desktop.
upgrade all packages with pip
# There isn't a built-in flag yet, but you can use
# Edit[0]: I've noticed that this fails when 'pip freeze' lists a package that cannot be installed from pypi anymore.
# Edit[1]: the command used to read "... | xargs echo pip install...", I've removed the "echo" so that the command actually performs the upgrade the install.
# Edit[2]: added a grep to skip "-e" package definitions, as suggested by @jawache
# Edit[3]: With newer versions of pip you can list outdated packages, though not in "requirements" format this possibility is actually built-in: pip list --outdated
# https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment