原文:点击查原文
1.查询所有过期库
(1) 打开命令提示符cmd
(2) pip list --outdated
2.批量升级过期库(通过循环来实现逐个升级)
(1) 打开Termial
(2) 进入Python 3.x Shell(打开python)
输入以下代码
import pip
from subprocess import call
from pip._internal.utils.misc import get_installed_distributions
for dist in get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)