Skip to content

Instantly share code, notes, and snippets.

@EdThePro101
Created August 9, 2020 00:07
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 EdThePro101/0b63edc6502692085c57374b7f15c8eb to your computer and use it in GitHub Desktop.
Save EdThePro101/0b63edc6502692085c57374b7f15c8eb to your computer and use it in GitHub Desktop.
Update all Python packages with pip.
# python pip-upgrade-all.py
#
# This file will upgrade all Python packages that are out of date.
#
# This file is a snippet from a Stack Overflow answer.
# Link: https://stackoverflow.com/a/5839291/9591441
import pkg_resources as pkg_res
from subprocess import call
packages = [package.project_name for package in pkg_res.working_set]
call('pip install --upgrade ' + ' '.join(packages), shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment