Yum --- there is no module named yum

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

enter image description here

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

+6
source share
5 answers

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

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

+24
source
 download this rpm python-2.4.3-46.el5_8.2.i386.rpm python-devel-2.4.3-46.el5_8.2.i386.rpm python-libs-2.4.3-46.el5_8.2.i386.rpm python-tools-2.4.3-46.el5_8.2.i386.rpm tix-8.4.0-11.fc6.i386.rpm tix-devel-8.4.0-11.fc6.i386.rpm tkinter-2.4.3-46.el5_8.2.i386.rpm yum-3.2.22-39.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/ [ root@localhost x]# ls python-2.4.3-46.el5_8.2.i386.rpm tix-8.4.0-11.fc6.i386.rpm python-devel-2.4.3-46.el5_8.2.i386.rpm tix-devel-8.4.0-11.fc6.i386.rpm python-libs-2.4.3-46.el5_8.2.i386.rpm tkinter-2.4.3-46.el5_8.2.i386.rpm python-tools-2.4.3-46.el5_8.2.i386.rpm yum-3.2.22-39.el5.centos.noarch.rpm [ root@localhost x]# rpm -Uvh --replacepkgs *.rpm Preparing... ########################################### [100%] 1:tix ########################################### [ 13%] 2:tix-devel ########################################### [ 25%] 3:python ########################################### [ 38%] 4:tkinter ########################################### [ 50%] 5:python-devel ########################################### [ 63%] 6:python-libs ########################################### [ 75%] 7:python-tools ########################################### [ 88%] 8:yum ########################################### [100%] [ root@localhost x]# yum update 
+2
source

You created a problem for yourself by removing pycurl with the --nodeps flag. To fix this error, reinstall the pycurl package on your system manually.

0
source

when "there is no module named yum", you must manually install the appropriate python and yum rpm package, for example:

rpm -i python * .rpm

rpm -i yum * .rpm

0
source

You can download rpm files manually from the link below.

http://mirror.centos.org/centos/7/os/x86_64/Packages/

0
source

Source: https://habr.com/ru/post/953218/


All Articles