利用pip批量升级packages

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pip
from pip._internal.utils.misc import get_installed_distributions
from subprocess import call

for dist in get_installed_distributions():
    print(dist)
    if not 'pip' in str(dist):
        call('pip3 install --upgrade %s -i https://pypi.tuna.tsinghua.edu.cn/simple' % dist.project_name, shell=True)

 

上一篇:使用Windows绘图合成多张图


下一篇:在windows部署service