Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yum---no module named yum

Tags:

python

yum

when I use yum in the shell,the error message is no module named yum, so I edit the /usr/bin/yum change the first line to another version of python, but nothing changes,and when I user different python to import yum, it brings out different error enter image description here

enter image description here

and when i use yum ,the message is like this: enter image description here the yum is ok before i use "rpm -e --nodeps pycurl" to remove pycurl...i need some help:(

like image 532
cjmandlulu Avatar asked Sep 05 '13 09:09

cjmandlulu


People also ask

How do I use yum in Python?

To start programming with YUM, we need to import the `yum` python package – this is installed by default in CENTOS 7. Along with `yum` we usually need the `os` and `sys` packages as well – so a typical python program using yum would begin with the following 3 lines.


1 Answers

Changing the first line of /usr/bin/yum to the default version of python may help.

eg.change #!/usr/bin/python to #!/usr/bin/python2.4

like image 56
PytLab Avatar answered Sep 23 '22 16:09

PytLab