Skip to content

Instantly share code, notes, and snippets.

@achillesrasquinha
Last active September 4, 2018 09:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achillesrasquinha/7098f6700cc2634c42e10b3aa8c61e3e to your computer and use it in GitHub Desktop.
Save achillesrasquinha/7098f6700cc2634c42e10b3aa8c61e3e to your computer and use it in GitHub Desktop.
A python script to update all your pip packages
@tananai
Copy link

tananai commented Mar 12, 2018

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