0%

python-pip-upgrade

升级单个类库

$ pip install --upgrade flask

升级所有类库

由于pip不支持批量操作,这里通过python代码升级

import pip
from subprocess import call

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

导出已安装的类库配置

$ pip freeze > requirements.txt

安装类库配置

$ pip install -r requirements.txt