Skip to content

Instantly share code, notes, and snippets.

@anudit
Created October 4, 2019 13:08
Show Gist options
  • Save anudit/55fed85f6cbbcce368166ab1f7fa2ddd to your computer and use it in GitHub Desktop.
Save anudit/55fed85f6cbbcce368166ab1f7fa2ddd to your computer and use it in GitHub Desktop.
Update all python packages using pip.
import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
for packageName in packages:
call(f"pip install --upgrade {packageName}", shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment