大家复制底下的代码并且保存成py文件执行即可,在python3环境下,执行成功。
import pip
from pip._internal.utils.misc import get_installed_distributions
from subprocess import call
import time
for dist in get_installed_distributions():
print(dist.project_name)
for dist in get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
标签:dist,get,Python,installed,pip,import,distributions,第三方 From: https://blog.51cto.com/u_15906863/5978180