"ImportError: No module named bz2"의 두 판 사이의 차이

41번째 줄: 41번째 줄:
</source>
</source>
*[[Python 2.7 설치]] 참고하여 Python 설치(또는 재설치)
*[[Python 2.7 설치]] 참고하여 Python 설치(또는 재설치)
<source lang='dos'>
[root@jmnote ~]# /usr/bin/python -c "import bz2; print bz2.__doc__"
The python bz2 module provides a comprehensive interface for
the bz2 compression library. It implements a complete file
interface, one shot (de)compression functions, and types for
sequential (de)compression.
</source>
:→ bz2 모듈 인식됨


==같이 보기==
==같이 보기==

2014년 2월 7일 (금) 14:11 판

1 문제상황

[root@jmnote pywikipedia]# python category.py move
Traceback (most recent call last):
  File "category.py", line 99, in <module>
    import os, re, pickle, bz2
ImportError: No module named bz2

2 해결방법

[root@jmnote ~]# rpm -qa | grep bzip2-devel
[root@jmnote ~]#
[root@jmnote ~]# yum install bzip2-devel
... (생략)
======================================================================================================
 Package                   Arch                 Version                      Repository          Size
======================================================================================================
Installing:
 bzip2-devel               x86_64               1.0.5-7.el6_0                base               250 k

Transaction Summary
======================================================================================================
Install       1 Package(s)

Total download size: 250 k
Installed size: 412 k
Is this ok [y/N]: y
Installed:
  bzip2-devel.x86_64 0:1.0.5-7.el6_0                                                                  

Complete!
[root@jmnote ~]# rpm -qa | grep bzip2-devel
bzip2-devel-1.0.5-7.el6_0.x86_64
[root@jmnote ~]# /usr/bin/python -c "import bz2; print bz2.__doc__"
The python bz2 module provides a comprehensive interface for
the bz2 compression library. It implements a complete file
interface, one shot (de)compression functions, and types for
sequential (de)compression.
→ bz2 모듈 인식됨

3 같이 보기

4 참고 자료

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