批量更新python库

1 import pip
2 from subprocess import call
3 
4 for dist in pip.get_installed_distributions():
5     try:
6         call("pip install --upgrade " + dist.project_name, shell=True)
7     except Exception as e:
8         print(e)
原文地址:https://www.cnblogs.com/laresh/p/7642126.html