"No module named yum"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(같은 사용자의 중간 판 하나는 보이지 않습니다)
6번째 줄: 6번째 줄:
* yum이 제대로 작동하지 않는다…<ref>[[/usr/bin/yum]]도 파이썬 스크립트임</ref>
* yum이 제대로 작동하지 않는다…<ref>[[/usr/bin/yum]]도 파이썬 스크립트임</ref>


<source lang='cli'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum
[root@zetawiki ~]# yum
There was a problem importing one of the Python modules
There was a problem importing one of the Python modules
24번째 줄: 24번째 줄:
the yum faq at:
the yum faq at:
   http://yum.baseurl.org/wiki/Faq
   http://yum.baseurl.org/wiki/Faq
</source>
</syntaxhighlight>
다음과 같이 /usr/bin/yum 파일을 수정하자.
다음과 같이 /usr/bin/yum 파일을 수정하자.
:기존 버전이 2.4이였다면  <code>#!/usr/bin/python</code> → <code>#!/usr/bin/python2.4</code>
:기존 버전이 2.4이였다면  <code>#!/usr/bin/python</code> → <code>#!/usr/bin/python2.4</code>
:기존 버전이 2.6이였다면  <code>#!/usr/bin/python</code> → <code>#!/usr/bin/python2.6</code>
:기존 버전이 2.6이였다면  <code>#!/usr/bin/python</code> → <code>#!/usr/bin/python2.6</code>
<source lang='cli'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# cp /usr/bin/yum /usr/bin/yum_old
[root@zetawiki ~]# cp /usr/bin/yum /usr/bin/yum_old
[root@zetawiki ~]# sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.6/g' /usr/bin/yum
[root@zetawiki ~]# sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.6/g' /usr/bin/yum
36번째 줄: 36번째 줄:
---
---
> #!/usr/bin/python2.6
> #!/usr/bin/python2.6
</source>
</syntaxhighlight>
<source lang='cli'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum
[root@zetawiki ~]# yum
... (생략)
... (생략)
44번째 줄: 44번째 줄:
     --advisory=ADVISORY
     --advisory=ADVISORY
                         Include packages needed to fix the given advisory
                         Include packages needed to fix the given advisory
</source>
</syntaxhighlight>
:→ 이제 잘 된다.
:→ 이제 잘 된다.



2020년 11월 2일 (월) 02:31 기준 최신판

1 개요[ | ]

No module named yum 고치기
yum 오류 고치기
  • Python 또는 yum을 업그레이드 한 경우
  • Python 버전이 맞지 않아 yum 모듈 버전이 맞지 않는 경우
  • yum이 제대로 작동하지 않는다…[1]
[root@zetawiki ~]# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.9 (default, Jan 21 2015, 20:29:09) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

다음과 같이 /usr/bin/yum 파일을 수정하자.

기존 버전이 2.4이였다면 #!/usr/bin/python#!/usr/bin/python2.4
기존 버전이 2.6이였다면 #!/usr/bin/python#!/usr/bin/python2.6
[root@zetawiki ~]# cp /usr/bin/yum /usr/bin/yum_old
[root@zetawiki ~]# sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.6/g' /usr/bin/yum
[root@zetawiki ~]# diff /usr/bin/yum_old /usr/bin/yum
1c1
< #!/usr/bin/python
---
> #!/usr/bin/python2.6
[root@zetawiki ~]# yum
... (생략)
    --sec-severity=SEVERITY
                        Include security relevant packages, of this severity
    --advisory=ADVISORY
                        Include packages needed to fix the given advisory
→ 이제 잘 된다.

2 같이 보기[ | ]

3 주석[ | ]

  1. /usr/bin/yum도 파이썬 스크립트임
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}