LoginSignup
3
2

More than 5 years have passed since last update.

pip 標準機能だけでパッケージを更新

Last updated at Posted at 2016-05-23

とりあえずささっと pip の標準機能だけで管理しているパッケージを更新したい方向けです。

準備

環境は Win7 64bit です。
PyCharm を起動していると更新でアクセスエラーが起きますので終了してください。
コマンドプロンプトを管理者権限で起動してコマンド入力します。

パッケージ一覧の表示

pip list -o
で、パッケージの一覧を取得します。
先頭にパッケージ名が表示され、その後に現在のバージョンと最新のバージョンも表示されます。

>pip list -o
Pillow (2.8.1) - Latest: 3.2.0 [wheel]
PySide (1.2.2) - Latest: 1.2.4 [wheel]
setuptools (12.0.5) - Latest: 21.2.1 [wheel]

パッケージの更新

pip install -U パッケージ名
あとは、手動でパッケージを更新します。 -U は --upgrade と同じです。
たとえば Pillow パッケージのアップデートならば次のようになります。

>pip install -U Pillow
Collecting Pillow
Downloading Pillow-3.2.0-cp34-none-win32.whl (1.2MB)
100% |################################| 1.2MB 793kB/s
Installing collected packages: Pillow
Found existing installation: Pillow 2.8.1
Uninstalling Pillow-2.8.1:
Successfully uninstalled Pillow-2.8.1
Successfully installed Pillow-3.2.0

3
2
0

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
3
2