Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-31-2017, 09:02 AM   #1
Registered: Apr 2013
Posts: 103

Rep: Reputation: Disabled
No module named yum - yum broken

Hello everyone. I'll start by admitting that I broke yum by installing a different default python on my unit (CentOS 7). Lucky for me this unit is for testing so it's no big deal to redo it.

But I spent hours and hours searching the internet trying to find a solution, but nobody seems to have one. And I'm wondering if there is just not a solution for this.

The problem seems to be the yum module missing from python. Here is what I get when I try to import yum from my (current) default python:

[root@tsks-01 ~]# /usr/local/bin/python
Python 2.7.5 (default, Jul 28 2017, 21:25:59) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named yum
>>> quit()
I have 2 versions of python installed and I get this error for both, so I cannot fix this by changing the path in /usr/bin/yum

What I want to find out is how to install yum as an individual module in python.

So here is my official question:

How does one install the yum module in python?

Additional distro info:
[root@tsks-01 ~]# uname -a
Linux 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@tsks-01 ~]# cat /etc/*elease
CentOS Linux release 7.3.1611 (Core) 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS Linux 7 (Core)"


CentOS Linux release 7.3.1611 (Core) 
CentOS Linux release 7.3.1611 (Core)
Thank you for any advice.


Last edited by keif; 07-31-2017 at 09:03 AM. Reason: removed domain
Old 07-31-2017, 09:28 PM   #2
Registered: Mar 2008
Posts: 20,997

Rep: Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406Reputation: 3406
Some ideas that may still work.

Last edited by jefro; 07-31-2017 at 09:32 PM.
Old 08-01-2017, 04:38 AM   #3
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Old 08-02-2017, 05:44 PM   #4
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,523

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
manually reinstall python rpm's from the update or base repo
-- it dose depend on if you updated before you replaced the DEFAULT python 2 version

then clean out the rpm database and yum database
and update


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken Yum - No module named yum scratchyrat Linux - Software 1 03-22-2013 09:58 PM
problem when run yum (No module named yum) ezak Linux - Distributions 4 10-16-2009 04:04 AM
Problem Installing Yum: "No module named yum" braclayrab Linux - Newbie 9 08-04-2009 06:57 PM
YUM no module named yum gimmee Fedora 7 12-06-2006 03:43 PM
broken yum - "No module named yum" shihab-alain Linux - Software 2 05-10-2006 05:09 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration