- 安装模块
pip install pymysql
- 查看需升级的包
pip list --outdated
- 更新单个包
pip install --upgrade pip
- 一键升级所有包
执行以下脚本或者直接在python命令行中运行
import pip
from subprocess import call
from pip._internal.utils.misc import get_installed_distributions
if __name__=='__main__':
for dist in get_installed_distributions():
call('pip install --upgrade '+dist.project_name,shell=True)