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

잔글 (로봇: 자동으로 텍스트 교체 (-<source lang='dos'> +<source lang='cli'>))
1번째 줄: 1번째 줄:
==문제상황==
==문제상황==
<source lang='dos'>
<source lang='cli'>
[root@jmnote pywikipedia]# python category.py move
[root@jmnote pywikipedia]# python category.py move
Traceback (most recent call last):
Traceback (most recent call last):
10번째 줄: 10번째 줄:


==해결방법==
==해결방법==
<source lang='dos'>
<source lang='cli'>
[root@jmnote ~]# rpm -qa | grep bzip2-devel
[root@jmnote ~]# rpm -qa | grep bzip2-devel
[root@jmnote ~]#  
[root@jmnote ~]#  
</source>
</source>
<source lang='dos'>
<source lang='cli'>
[root@jmnote ~]# yum install bzip2-devel
[root@jmnote ~]# yum install bzip2-devel
... (생략)
... (생략)
31번째 줄: 31번째 줄:
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</source>
<source lang='dos'>
<source lang='cli'>
Installed:
Installed:
   bzip2-devel.x86_64 0:1.0.5-7.el6_0                                                                   
   bzip2-devel.x86_64 0:1.0.5-7.el6_0                                                                   
37번째 줄: 37번째 줄:
Complete!
Complete!
</source>
</source>
<source lang='dos'>
<source lang='cli'>
[root@jmnote ~]# rpm -qa | grep bzip2-devel
[root@jmnote ~]# rpm -qa | grep bzip2-devel
bzip2-devel-1.0.5-7.el6_0.x86_64
bzip2-devel-1.0.5-7.el6_0.x86_64
</source>
</source>
*[[Python 2.7 설치]] 참고하여 Python 설치(또는 재설치)
*[[Python 2.7 설치]] 참고하여 Python 설치(또는 재설치)
<source lang='dos'>
<source lang='cli'>
[root@jmnote ~]# /usr/bin/python -c "import bz2; print bz2.__doc__"
[root@jmnote ~]# /usr/bin/python -c "import bz2; print bz2.__doc__"
The python bz2 module provides a comprehensive interface for
The python bz2 module provides a comprehensive interface for

2015년 2월 6일 (금) 02:32 판

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
→ 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 }}