Python 모듈 수동 설치

1 개요[ | ]

파이썬 모듈 수동 설치
Python 모듈 수동 설치
Python tar.gz 모듈 설치
PyPI를 통한 python 모듈 설치
  • https://pypi.python.org/pypi 에서 원하는 모듈 검색하여 tar.gz 파일 다운로드 후 설치하는 방법
  • pip와 달리, 인터넷 안되는 환경에서도 설치 가능
  • 단, 의존성 관리는 지원되지 않으므로 수동으로 해결해야 함
즉 필요한 모듈이 있다면 추가로 수동설치해야 함
  • tar.gz 파일(소스코드 압축파일) 이외에, egg 파일이 있다면 easy_install로 설치하는 것도 OK

2 확인[ | ]

[root@zetawiki ~]# python -c 'import simplejson'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named simplejson

3 다운로드[ | ]

  • 웹브라우저에서 https://pypi.python.org/pypi 접속
  • 우상단 검색창에 simplejson Enter
  • 패키지 목록에서 simplejson 3.8.1 클릭
  • [Download] 클릭하여 simplejson-3.8.1.tar.gz 다운로드

4 설치[ | ]

  • 서버에 simplejson-3.8.1.tar.gz 업로드
[root@zetawiki ~]# ll simplejson*
-rw-r--r-- 1 root root 76033 Feb 16 14:47 simplejson-3.8.1.tar.gz
  • 압축 해제
[root@zetawiki ~]# tar xvzf simplejson-3.8.1.tar.gz
simplejson-3.8.1/
simplejson-3.8.1/CHANGES.txt
simplejson-3.8.1/conf.py
... (생략)
simplejson-3.8.1/simplejson.egg-info/PKG-INFO
simplejson-3.8.1/simplejson.egg-info/SOURCES.txt
simplejson-3.8.1/simplejson.egg-info/top_level.txt
  • 설치
[root@zetawiki ~]# cd simplejson-3.8.1
[root@zetawiki simplejson-3.8.1]# python setup.py install
... (생략)
byte-compiling /usr/local/lib/python2.7/site-packages/simplejson/compat.py to compat.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/site-packages/simplejson-3.8.1-py2.7.egg-info

5 확인 2[ | ]

[root@zetawiki simplejson-3.8.1]# cd
[root@zetawiki ~]# python -c 'import simplejson'
[root@zetawiki ~]#

6 같이 보기[ | ]

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