For pip < 10.0.1
import pip
from subprocess import call
packages = [dist.project_name for dist in pip.get_installed_distributions()]
call("pip install --upgrade " + ' '.join(packages), shell=True)
For pip >= 10.0.1
import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
call("pip install --upgrade " + ' '.join(packages), shell=True)
https://gist.github.com/SeppPenner/efc73891480b67c561aac7ba47df9df7
Keine Kommentare:
Kommentar veröffentlichen