Created
August 1, 2014 15:56
-
-
Save erikcox/00437c17a813870b75b7 to your computer and use it in GitHub Desktop.
Update Python modules with pip (*nix/OS X)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import pip | |
dists = [] | |
for dist in pip.get_installed_distributions(): | |
dists.append(dist.project_name) | |
for dist_name in sorted(dists, key=lambda s: s.lower()): | |
cmd = "sudo pip install {0} -U".format(dist_name) | |
print '#', cmd | |
os.system(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I run
python .\PythonUpdateAll.py
it returns: