Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A python script to update all your pip packages
@corradopetrelliunicam
Copy link

Thanks!!!

@holm-xie
Copy link

holm-xie commented Aug 3, 2018

since get_installed_distributions() is an internal function of pip, maybe it is proper to get packages by:

import pkg_resources
packages = [i for i in pkg_resources.working_set if i.project_name != "Python"]

or simply packages = [i for in __import__('pkg_resources').working_set if i.project_name != "Python"]

@achillesrasquinha
Copy link
Author

Thanks for the update, I prefer using the get_installed_distributed function from pip. Seems to be in pip._internal.utils.misc

@achillesrasquinha
Copy link
Author

achillesrasquinha commented Sep 4, 2018

Hi @holm-xie @corradopetrelli, I've permanently moved the script to a seperate package http://git.io/pipupgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment