python一键升级所有pip package的方法

pip_ungrade_all.py代码如下:

# -*- coding: utf-8 -*-


import pip
from subprocess import call

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

以管理身份执行脚本pip_ungrade_all.py

# python pip_ungrade_all.py

相关推荐