One - One Code All

Blog Content

pip --upgrade批量更新过期的python库

Python   2010-05-30 20:53:22

pip批量更新包

pip list  #列出所有安装的库
pip list --outdated #列出所有过期的库
pip install --upgrade 库名
pip install --upgrade 库名==版本号
# 用 pip-review 批量更新
pip install pip-review
pip-review --local --interactive

python代码批量更新

#批量更新
import pip
from subprocess import call
 
for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)



上一篇:python内置函数map()
下一篇:python random从集合中随机选择元素

The minute you think of giving up, think of the reason why you held on so long.