Python pip 批量更新库脚本

为什么80%的码农都做不了架构师?>>>   hot3.png

import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    print("check for " + dist.project_name)
    call("pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple/ %s"%dist.project_name, shell=True)

#列出所有过期的库:

pip list --outdated

#更新库:

pip install --upgrade 库名

转载于:https://my.oschina.net/hotkit/blog/1622030

你可能感兴趣的:(python,shell)