PyPi——批量更新

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

今天看了下系统环境,不少python库都有了更新,再用旧版本库可能已经不适合了,就想把所有的库都更新到最新版本。

查看系统里过期的python库,可以用pip命令

pip list  #列出所有安装的库
pip list --outdated #列出所有过期的库

对于列出的过期库,pip也提供了更新的命令

pip install --upgrade 库名  

演示:

root@CoralOptimal-VM:/usr/local/bin# pip list --outdated             
Package   Version Latest Type 
--------- ------- ------ -----
pygobject 3.20.0  3.32.1 sdist
wheel     0.29.0  0.33.4 wheel
root@CoralOptimal-VM:/usr/local/bin# pip install --upgrade wheel    
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: wheel
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
      Successfully uninstalled wheel-0.29.0
Successfully installed wheel-0.33.4
原文地址:https://www.cnblogs.com/tingguoguoyo/p/10955324.html