Skip to content

Instantly share code, notes, and snippets.

@EdThePro101
Created August 9, 2020 00:07
Embed
What would you like to do?
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