0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

python実行環境にインストールされているpipパッケージを一覧表示する

Posted at

用途

  • クラウド上のPython実行環境だと、どのパッケージがインストールされているかわからないことがある
    • (ドキュメンテーションされていても更新されてなかったり)
  • そういう環境で使えるパッケージをぱっと確認するのに使える
import pkg_resources
import pprint

installed_packages = pkg_resources.working_set
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
   for i in installed_packages])
pprint.pprint(installed_packages_list)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?