Skip to content

Instantly share code, notes, and snippets.

@MOOOWOOO
Last active October 7, 2018 15:19
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 MOOOWOOO/81fd785c3d3dcf6e0c11 to your computer and use it in GitHub Desktop.
Save MOOOWOOO/81fd785c3d3dcf6e0c11 to your computer and use it in GitHub Desktop.
pip-upgrade
#!/usr/bin/python
# -*- coding:utf-8 -*-
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip2 install --upgrade {}".format(dist.project_name), shell=True)
#!/usr/bin/python3
# -*- coding:utf-8 -*-
from pip._internal.utils.misc import get_installed_distributions
from subprocess import call
for dist in get_installed_distributions():
call("pip3 install --upgrade {}".format(dist.project_name), shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment