Python 설치된 모듈 목록

Jmnote (토론 | 기여)님의 2020년 4월 13일 (월) 00:00 판 (→‎참고)
Python 설치 모듈 목록 확인

1 방법 1: pip

  • 2020년 현재에 이르러서는 가장 표준적인 방법
  • pip가 설치되어 있어야 함 (Python 함께 설치되는 경우가 대부분)
  • 기본 내장 모듈은 나오지 않음
[root@zetawiki ~]# pip list
distribute (0.6.10)
Django (1.6.5)
Flask (0.10.1)
iniparse (0.3.1)
...
[root@zetawiki ~]# pip freeze
Django==1.6.5
Flask==0.10.1
Jinja2==2.7.3
...

2 방법 2: get_installed_distributions

  • pip가 설치되어 있어야 함
  • 기본 내장 모듈은 나오지 않음
  • 설치 위치 확인 가능
[root@zetawiki ~]# python -c 'import pip,pprint; pprint.pprint(pip.get_installed_distributions())'
[MySQL-python 1.2.3 (/usr/lib64/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg),
 Flask 0.10.1 (/usr/lib/python2.6/site-packages/Flask-0.10.1-py2.6.egg),
 itsdangerous 0.24 (/usr/lib/python2.6/site-packages/itsdangerous-0.24-py2.6.egg),
 Jinja2 2.7.3 (/usr/lib/python2.6/site-packages/Jinja2-2.7.3-py2.6.egg),
...

3 방법 3: pydoc

[root@zetawiki ~]# pydoc modules

Please wait a moment while I gather a list of all available modules...

BaseHTTPServer      ast                 imp                 shlex
Bastion             asynchat            importlib           shutil
CDROM               asyncore            imputil             signal
... (생략)
anydbm              ihooks              sgmllib             
argparse            imaplib             sha                 
array               imghdr              shelve              

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

4 방법 4: help

  • 명령어가 다를 뿐 결과는 pydoc과 거의 같음
[root@zetawiki ~]# python -c 'help("modules")'

Please wait a moment while I gather a list of all available modules...

ANSI                bisect              io                  screen
BaseHTTPServer      bsddb               itertools           select
Bastion             bz2                 itsdangerous        sets
... (생략)

5 같이 보기

6 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}