LoginSignup
54
44

More than 5 years have passed since last update.

pip で更新可能なパッケージを一覧表示

Posted at

pip のインストール済みパッケージの一覧表示

インストールされているパッケージの一覧は pip listpip freeze で表示できる。が、オプションをつければ更新可能なパッケージの一覧や最新状態のパッケージ一覧も表示できる。
インストール済みパッケージを一括で更新したい場合はこれを使えば便利。

かなり昔は pip-tools の pip-review コマンドを使うしかなかったので pip のオプションでできるようになって便利。

更新可能なパッケージ一覧表示

$ pip list -o
google-api-python-client (1.5.0) - Latest: 1.5.1 [wheel]
Pillow (3.1.1) - Latest: 3.2.0 [sdist]
pytz (2015.7) - Latest: 2016.4 [wheel]

オプションは -o または --outdated

最新パッケージ一覧表示

$ pip list -u
pip (8.1.2)
ujson (1.35)
wheel (0.29.0)

オプションは -u または --uptodate

更新可能なパッケージの一括更新

全部最新にして問題なければ以下でOK。

$ pip list -o | awk '{print $1}' | xargs pip install -U
54
44
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
44