编程语言
首页 > 编程语言> > python ---升级所有安装过的package

python ---升级所有安装过的package

作者:互联网

# -*- coding:utf8 -*-
import pip
from subprocess import call
from pip._internal.utils.misc import get_installed_distributions


if __name__ == '__main__':
    for dist in get_installed_distributions(): 
        call("pip install --upgrade " + dist.project_name, shell=True)

 

命令行运行

标签:__,dist,package,python,升级,call,pip,import,distributions
来源: https://www.cnblogs.com/saryli/p/11387062.html