Created
January 31, 2019 04:45
-
-
Save codeliger/6071ff0f646f6dc3d61463067ef2fb9f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
''' | |
Upgrades all pip packages to the latest version | |
''' | |
from subprocess import check_output, call | |
import json | |
VERSION = '3.7' | |
CMD_OUTDATED_PACKAGES = f'python -m pip list --format json -o' | |
CMD_INSTALL_UPGRADE = 'python -m pip install {} --user --upgrade' | |
packages = json.loads(check_output(CMD_OUTDATED_PACKAGES.split())) | |
for package in packages: | |
call(CMD_INSTALL_UPGRADE.format(package['name']).split()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment